Recent

Author Topic: TTrackBar issue  (Read 9173 times)

Waco

  • Jr. Member
  • **
  • Posts: 61
TTrackBar issue
« on: March 28, 2010, 08:28:19 pm »
Hi, I'd like to be able to change the position of a track bar manually from the application. There's no problem with changing the Position property, but it's obviously just the return value, it cannot backwards influence the real position. So how could I do that?

I tried a few things, but what I don't get is this. I looked in the documentation and it seems that TTrackBar is a subclass of TCustomTrackBar. This class should have some possibly useful procedures. For example, ApplyChanges or FixParams(), but IDE keeps saying that it identifies no member of the TTrackBar class. What is wrong? Thanks for your assistance.

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: TTrackBar issue
« Reply #1 on: March 29, 2010, 08:15:21 pm »
There's no problem with changing the Position property, but it's obviously just the return value, it cannot backwards influence the real position. So how could I do that?
What is it you want to accomplish?
Doesn't the trackbar change if you change the Position value in your code?
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

Waco

  • Jr. Member
  • **
  • Posts: 61
Re: TTrackBar issue
« Reply #2 on: March 29, 2010, 10:26:36 pm »
Well, I was hoping that I could do one thing by two ways. One by moving the track bar and the other one by scrolling on a certain picture, doesn't really matter. But when I scroll I want the track bar to move simultaneously, to avoid any bugs.

Like I explained, the real position of that track bar cannot be influenced by its Position property, it's apparently used only for output, for you to know how's the user changed the track bar. That two procedures I mentioned before seems useful to me, but I don't know how to make them work. Please, can anyone suggest anything?

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: TTrackBar issue
« Reply #3 on: March 30, 2010, 01:50:11 pm »
Are we talking about a track bar or scroll bar?
(Two different things...)
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

Waco

  • Jr. Member
  • **
  • Posts: 61
Re: TTrackBar issue
« Reply #4 on: March 30, 2010, 04:36:29 pm »
Ah, I shouldn't have written that, it was just confusing. By scrolling I meant only that my application performs certain procedure when you wheel up or wheel down with your mouse. I would like the track bar to move and that's where I have the problem.

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: TTrackBar issue
« Reply #5 on: March 30, 2010, 05:29:43 pm »
Can't you use the OnMouseWheel... events?
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

Waco

  • Jr. Member
  • **
  • Posts: 61
Re: TTrackBar issue
« Reply #6 on: March 30, 2010, 08:08:45 pm »
Ok, I just learnt that 'dec()' or 'inc()' are not exactly the same as using ':='. Yes, if I change the Position property of my track bar, it really moves. Well, sorry for the time you wasted replying me. My bad.

PS: We really got off the original topic, I had had a problem with a track bar, not the mouse wheels. Nevermind, though :)

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2583
Re: TTrackBar issue
« Reply #7 on: March 31, 2010, 01:31:58 pm »
Ok, I just learnt that 'dec()' or 'inc()' are not exactly the same as using ':='.
That's why it is in the current release of the compiler not possible to use Inc() or Dec() on properties
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

 

TinyPortal © 2005-2018