Recent

Author Topic: How to show a scrollbar on the TForm?  (Read 7406 times)

zamtmn

  • Sr. Member
  • ****
  • Posts: 365
How to show a scrollbar on the TForm?
« on: July 06, 2013, 07:29:21 am »
How to show a scrollbar on the form?
Code: [Select]
procedure TForm1._oncreate(Sender: TObject);
begin
  self.VertScrollBar.Range:=1000;
end;
Works in GTK2, but does not work in qt

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: How to show a scrollbar on the TForm?
« Reply #1 on: July 06, 2013, 08:02:18 am »
Have you checked the Lazarus restriction browser to see if the LCL does support that on qt?
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

zeljko

  • Hero Member
  • *****
  • Posts: 1079
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: How to show a scrollbar on the TForm?
« Reply #2 on: July 06, 2013, 09:04:43 am »
How to show a scrollbar on the form?
Code: [Select]
procedure TForm1._oncreate(Sender: TObject);
begin
  self.VertScrollBar.Range:=1000;
end;
Works in GTK2, but does not work in qt

No way atm. I must implement QAbstractScroll area for central widget on the form for that purpose.

zamtmn

  • Sr. Member
  • ****
  • Posts: 365
Re: How to show a scrollbar on the TForm?
« Reply #3 on: July 06, 2013, 08:39:03 pm »
>>BigChimp
No, I did not find there it

>>zeljko
This will be corrected, or will remain and need to do some other mechanism to scroll in my application?

taazz

  • Hero Member
  • *****
  • Posts: 5363
Re: How to show a scrollbar on the TForm?
« Reply #4 on: July 06, 2013, 09:34:17 pm »
I don't know if this will work on qt but have tried something stupid like

1) creat a Tshape with pen.style = psclear and brush.style := bsclear
2) Set Form.AutoScroll := true;
3) Set Shape1 Top := 3000, widht := 0; height := 0; left :=0 or 2000 for an horizintal bar too.

Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Blaazen

  • Hero Member
  • *****
  • Posts: 2782
  • POKE 54296,15
    • Eye-Candy Controls
Re: How to show a scrollbar on the TForm?
« Reply #5 on: July 06, 2013, 09:54:06 pm »
I tested and no, it does not work with qt. But works well with Gtk2.
Lazarus 2.1.0 r59757M FPC 3.3.1 r40507 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.2, Plasma 5.14.2
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

zamtmn

  • Sr. Member
  • ****
  • Posts: 365
Re: How to show a scrollbar on the TForm?
« Reply #6 on: July 06, 2013, 09:55:37 pm »
No, does not work, scrollbars do not appear

taazz

  • Hero Member
  • *****
  • Posts: 5363
Re: How to show a scrollbar on the TForm?
« Reply #7 on: July 06, 2013, 10:44:26 pm »
Sorry I have no more ideas just one more reason not to use QT for now.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

zeljko

  • Hero Member
  • *****
  • Posts: 1079
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: How to show a scrollbar on the TForm?
« Reply #8 on: July 07, 2013, 11:22:53 am »
>>BigChimp
No, I did not find there it

>>zeljko
This will be corrected, or will remain and need to do some other mechanism to scroll in my application?

Yes it will be corrected, but do not expect it soon since I'm going to holidays in 2 weeks, and won't do anything about it before september/october. Workaround: add TScrollBox as child of form (alClient), put your controls there and then do whatever with your scrollbars.

zeljko

  • Hero Member
  • *****
  • Posts: 1079
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: How to show a scrollbar on the TForm?
« Reply #9 on: July 07, 2013, 11:23:11 am »
Sorry I have no more ideas just one more reason not to use QT for now.

And what are other reasons ?

taazz

  • Hero Member
  • *****
  • Posts: 5363
Re: How to show a scrollbar on the TForm?
« Reply #10 on: July 07, 2013, 12:12:30 pm »
From the top of my head QT does not support MyVar := Form1.canvas.pixels[x,y]; It can't return data back, from 4 and up it doesn't support form2.popupparent := Form1; witch forces form2 to always stay on top of form1 regardless of focus .....

Oh well I can't think anything else now, need cofeee......
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

zamtmn

  • Sr. Member
  • ****
  • Posts: 365
Re: How to show a scrollbar on the TForm?
« Reply #11 on: July 07, 2013, 08:48:31 pm »
I create report http://bugs.freepascal.org/view.php?id=24715
taazz
I look at the development of GTK3 and WINDOWS8 and I think that only KDE@QT is right desktop for PC. QT need to use and develop

taazz

  • Hero Member
  • *****
  • Posts: 5363
Re: How to show a scrollbar on the TForm?
« Reply #12 on: July 07, 2013, 09:30:06 pm »
Desktop environments come and go, widget sets are what we use. even on windows I can completely replace explorer as the desktop environment if need it be.
Don't get me wrong I like QT I find it powerful enough to use it but not enough to drop win32 yet and compared with GTK it has its strong points if it could give more attention to basic functionality I wouldn't even think of using gtk.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

zeljko

  • Hero Member
  • *****
  • Posts: 1079
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: How to show a scrollbar on the TForm?
« Reply #13 on: July 08, 2013, 08:02:12 am »
From the top of my head QT does not support MyVar := Form1.canvas.pixels[x,y]; It can't return data back, from 4 and up it doesn't support form2.popupparent := Form1; witch forces form2 to always stay on top of form1 regardless of focus .....

Oh well I can't think anything else now, need cofeee......

Actually, DCGetPixel() works under qt (which is used by Canvas.Pixels[x, y] but only if bitmap is selected into device context.
Pls. open an issue about it and attach example which does not work.