Recent

Author Topic: TDragBar Change event  (Read 10520 times)

GAlex

  • New Member
  • *
  • Posts: 13
TDragBar Change event
« on: January 02, 2005, 07:33:38 pm »
Maybe I've found a new bug, maybe not, but have a look at the following
Code: [Select]

unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ComCtrls,
  StdCtrls;

type
  TForm1 = class(TForm)
    StaticText1: TStaticText;
    TrackBar1: TTrackBar;
    procedure TrackBar1Change(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;

implementation

{ TForm1 }

procedure TForm1.TrackBar1Change(Sender: TObject);
var s: string;
begin
  str(trackbar1.position:2, s);
  statictext1.caption:=s;
end;

initialization
  {$I unit1.lrs}

end.

There is a standard Form, a StaticText, a DragBar;
 ... running the app and dragging the dragbar ...
 ... NOTHING HAPPENS!!!

the callback routine has never been called!!!

In Delphi6 the above code runs well, and the static text displays the dragbar position.

What's wrong?

BTW I'm actually running win32 + Laz-0.9.2 beta.

GAlex

  • New Member
  • *
  • Posts: 13
Update!
« Reply #1 on: January 06, 2005, 01:02:20 pm »
Ahem ... is anybody out there???

I've Updated to the latest Lazarus Build, but the problem remains, and the previous code doesn't work.

I've also looked at the control source code, but found nothing interesting (it should work well), maybe I've trascurated somthing important but can't think of anything wrong.

Please help, I'm stuck with my current project 'cause it makes use of the DragBar.

Thanks in advance.

matthijs

  • Hero Member
  • *****
  • Posts: 537
TDragBar Change event
« Reply #2 on: January 06, 2005, 05:23:17 pm »
I just started a new project (under Linux) and had the following code working correctly:
Code: [Select]

procedure TForm1.TrackBar1Change(Sender: TObject);
begin
  StaticText1.Caption := 'TrackBar.pos: ' + IntToStr(TrackBar1.Position);
end;

I'm running the latest Lazarus version, under Windows I see the same problem as you do. The caption doesnot get update.

I even added StaticText1.Invalidate and Application.ProcessMessages to the method, nothings helps. :(
What's in a sig? Would my posting look less if it didnot have a sig? (Free after William S.) :)

:( Why cannot I upload my own Avatar? :(

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
TDragBar Change event
« Reply #3 on: January 06, 2005, 08:19:08 pm »
Well, if two people got the same problem, it is more likely a lazarus bug (maybe a NOT-YET-IMPLEMENTED) than a programmer error. Please, submit a bug report in the bug tracker.

matthijs

  • Hero Member
  • *****
  • Posts: 537
TDragBar Change event
« Reply #4 on: January 06, 2005, 08:52:42 pm »
Quote from: "Vincent"
Well, if two people got the same problem, it is more likely a lazarus bug (maybe a NOT-YET-IMPLEMENTED) than a programmer error. Please, submit a bug report in the bug tracker.


Done that now. :) Nr. 534.
What's in a sig? Would my posting look less if it didnot have a sig? (Free after William S.) :)

:( Why cannot I upload my own Avatar? :(

GAlex

  • New Member
  • *
  • Posts: 13
Fixed?
« Reply #5 on: January 09, 2005, 10:57:09 pm »
Ok, as stated in the bug tracking list, the bug #534 has been FIXED.

So, what must I do to get it working?

I've tried to download the latest cvs source, but that doesn't compile.

HELP!!! :cry:

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
TDragBar Change event
« Reply #6 on: January 09, 2005, 11:04:37 pm »
You must use the CVS version of lazarus, there is no new release yet.

 I have no problems compiling the CVS version. What errors do you get?

GAlex

  • New Member
  • *
  • Posts: 13
TDragBar Change event
« Reply #7 on: January 11, 2005, 10:10:47 pm »
Mhmhh, I've successfully compiled the VCS version and got a brand new 0.9.5 version running, but...

Opening my old project, I got errors on myproject.lfm about properties on statictext, then I'm unable to edit my form in form editor, cause it shows only the form code in the code editor  :twisted: buggy :twisted: .

Well, it seems that all my other old projects are working well, and new projects runs without problems, so I should only rewrite my project from scratch, since it were at an early stage, only a little accident.

Thanks very much to all, and by the way, yes, the bug has really benn fixed. :lol:

C#R#

  • New Member
  • *
  • Posts: 45
TDragBar Change event
« Reply #8 on: September 28, 2007, 04:38:05 am »
HI,
I´m here because I have the same problem.
I don´t know if it is helpfull, but I have an application
with old version of lazaus that´s running very well with
this component. Wen I try to compile with 9.22, on debug,
the GDB show the message:
Error reading trackbar1.ShowScale; unknown property: ShowScale.

Best regards.

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2696
TDragBar Change event
« Reply #9 on: September 28, 2007, 11:01:35 am »
Big chance that the ShowScale property got renamed or removed.
When you open your form in Lazarus do you get a editform to manually remove the property ?
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

C#R#

  • New Member
  • *
  • Posts: 45
TTrackBar
« Reply #10 on: October 27, 2007, 05:14:35 pm »
Hi,
Yes, I had this message.

Thanks.

 

TinyPortal © 2005-2018