Recent

Author Topic: TPageControl not showing all tabs  (Read 4167 times)

RedOctober

  • Sr. Member
  • ****
  • Posts: 450
Re: TPageControl not showing all tabs
« Reply #15 on: November 23, 2019, 07:49:40 pm »
Thank you @wp.  The component works as expected now, both in design time and run time.

RedOctober

  • Sr. Member
  • ****
  • Posts: 450
Re: TPageControl not showing all tabs
« Reply #16 on: December 31, 2019, 07:42:07 pm »
Uh-oh.  Same problem is occurring with the following controls.  Bc I am now "smarter", I was able to salvage my project before it was permanently damaged.  Calling on @wp, if you have time can you fix the following controls the same way you did for the image viewer?

TJvTimeLine
TJvMarkupViewer

Thanks.

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: TPageControl not showing all tabs
« Reply #17 on: December 31, 2019, 07:53:20 pm »
The rest of this thread seems to be about PageControl which does not have much in comon with JvTimeLine and JvMarkupViewer. Please give a description of what is wrong, and maybe post a demo project to show the issue.

RedOctober

  • Sr. Member
  • ****
  • Posts: 450
Re: TPageControl not showing all tabs
« Reply #18 on: December 31, 2019, 09:56:00 pm »
Hi @wp.  The relevant thread starts here:

https://forum.lazarus.freepascal.org/index.php/topic,47499.msg340208.html#msg340208

You have already fixed this in the JV image viewer.  A sample project has been submitted to you already and you used that to fix the control.  The page control losing pages is the symptom of the JV control(s) not being initiated properly (or something like that).

I hope this helps clear up the confusion.  It's a long thread so I can see why you'd miss the beginning.

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: TPageControl not showing all tabs
« Reply #19 on: January 01, 2020, 11:17:28 am »
One month is a long time, but now I remember. You refer to https://forum.lazarus.freepascal.org/index.php/topic,47499.msg340208.html#msg340208. Are there any more of the JVCL controls affected?

RedOctober

  • Sr. Member
  • ****
  • Posts: 450
Re: TPageControl not showing all tabs
« Reply #20 on: January 01, 2020, 04:58:01 pm »
Unknown at this time.  There are a *lot* of JV controls and I have only noticed this problem with the 3 I have tried.

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: TPageControl not showing all tabs
« Reply #21 on: January 01, 2020, 07:17:52 pm »
Which properties did you change for the JvTimeLine? A "naked" JvTimeLine does not show the issue. Same for a "naked" JvMarkupViewer (and JvMarkupLabel), but here the effect is triggered by setting the "Text".

[EDIT] Found it: After adding items to JvTimeTime the issue shows up.
« Last Edit: January 01, 2020, 07:40:31 pm by wp »

RedOctober

  • Sr. Member
  • ****
  • Posts: 450
Re: TPageControl not showing all tabs
« Reply #22 on: January 01, 2020, 09:22:04 pm »
Hi @wp.  Yes you are correct.  The "bad effect" did not happen until I added an time to the time line.

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: TPageControl not showing all tabs
« Reply #23 on: January 02, 2020, 03:59:11 pm »
Fixed in jvcllaz trunk. I also found TJvYearGrid and TJvMarkupLabel to show the same issue - fixed too. I quickly checked all the other components, but cannot guarantee because the effect seems to be triggered by setting some property.

RedOctober

  • Sr. Member
  • ****
  • Posts: 450
Re: TPageControl not showing all tabs
« Reply #24 on: January 19, 2021, 09:20:48 pm »
Hi Wp,

You made some changes to correct the "disappearing tabs" problem last November, that I installed, at that time, in my Laz 1.84:

File name on my system:  (I'll call this the November 2019 file, because that's when I got your edits last time)

C:\Lazarus184\config_lazarus\onlinepackagemanager\packages\jvcllaz\run\JvCustomControls\jvimagesviewer.pas


I have now installed Laz 2.0.10 and JV controls from the On-Line Package Manager, and I did a "Beyond Compare".
The files are different, so I'm thinking... to avoid this bug in the 2.0.10 IDE, should I make the edits in my "2010" file, so it matches your edits, or not?

File name on my system:  (I'll call this the January 2021 file, because that's when I acquired it)

C:\Installs\Lazarus_2010_Cnfg\onlinepackagemanager\packages\jvcllaz\run\JvCustomControls\jvimagesviewer.pas


November 2019 has these edits that the January 2021 file does not: 
(Added/Changed lines are indicated, other lines are the same in both files)

Code: Pascal  [Select][+][-]
  1. private
  2.     FImagePadding: Integer;
  3.     FFrameColor: TColor;
  4.     FHotFrameSize: Integer;
  5.     FHotColor: TColor;
  6.     FTransparent: Boolean;
  7.     function IsImagePaddingStored: Boolean;           <---- Added
  8.     procedure SetImagePadding(const Value: Integer);
  9.     procedure SetFrameColor(const Value: TColor);
  10.     procedure SetHotColor(const Value: TColor);
  11.     procedure SetHotFrameSize(const Value: Integer);
  12.     procedure SetTransparent(const Value: Boolean);
  13.   protected
  14.     {$IF LCL_FullVersion >= 1080000}           <---- Added
  15.     procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
  16.       const AXProportion, AYProportion: Double); override;
  17.     {$IFEND}           <---- Added
  18.  
  19.  
  20.  
  21.  published
  22.     property AutoCenter;
  23.     property Alignment;
  24.     property BrushPattern;
  25.     property DragAutoScroll;
  26.     property FrameColor: TColor read FFrameColor write SetFrameColor default clGray;
  27.     property Height;
  28.     property HorzSpacing;
  29.     property HotColor: TColor read FHotColor write SetHotColor default clHighlight;
  30.     property HotFrameSize: Integer read FHotFrameSize write SetHotFrameSize default 2;
  31.     property HotTrack;
  32.     property ImagePadding: Integer read FImagePadding write SetImagePadding stored IsImagePaddingStored;   <---- Changed
  33.                  // Corresponding line in January 2021 file:      property ImagePadding: Integer read FImagePadding write SetImagePadding default DEFAULT_IMAGEVIEWEROPTIONS_IMAGEPADDING;
  34.     property Layout;
  35.     property LazyRead;
  36.     property MultiSelect;
  37.     property ReduceMemoryUsage;
  38.     property RightClickSelect;
  39.     property Transparent: Boolean read FTransparent write SetTransparent default False;
  40.     property ScrollBar;
  41.     property ShowCaptions default True;
  42.     property Tracking;
  43.     property VertSpacing;
  44.     property Width;
  45.   end;
  46.  
  47.  
  48.  
  49. constructor TJvImageViewerOptions.Create(AOwner: TJvCustomItemViewer);
  50. begin
  51.   inherited Create(AOwner);
  52.   FImagePadding := Owner.Scale96ToFont(DEFAULT_IMAGEVIEWEROPTIONS_IMAGEPADDING);   <-- Changed
  53.       // Corresponding line in January 2021 file:     FImagePadding := DEFAULT_IMAGEVIEWEROPTIONS_IMAGEPADDING;
  54.   FFrameColor := clGray;
  55.   FHotColor := clHighlight;
  56.   FHotFrameSize := 2;
  57.   ShowCaptions := True;
  58. end;
  59.  
  60. {$IF LCL_FullVersion >= 1080000}
  61. procedure TJvImageViewerOptions.DoAutoAdjustLayout(
  62.   const AMode: TLayoutAdjustmentPolicy;
  63.   const AXProportion, AYProportion: Double);
  64. begin
  65.   inherited;
  66.   if AMode in [lapAutoAdjustWithoutHorizontalScrolling, lapAutoAdjustForDPI] then    
  67.   begin                                                                            
  68.     if IsImagePaddingStored then                                                     <-- Added
  69.       FImagePadding := Round(FImagePadding * AXProportion);                        
  70.   end;
  71. end;
  72. {$IFEND}
  73.  
  74. function TJvImageViewerOptions.IsImagePaddingStored: Boolean;
  75. begin
  76.   Result := FImagePadding <> Owner.Scale96ToFont(DEFAULT_IMAGEVIEWEROPTIONS_IMAGEPADDING);
  77. end;
  78.  
  79. procedure TJvPictureItem.DoLoadProgress(Sender: TObject;
  80.   Stage: TFPImgProgressStage; PercentDone: Byte; RedrawNow: Boolean;
  81.   const R: TRect; const Msg: AnsiString; var Continue: Boolean);
  82. begin
  83.   if Owner is TJvImagesViewer then  <-- Changed
  84.     Corresponding line in January 2021 file:    if Continue and (Owner is TJvImagesViewer) then
  85.     TJvImagesViewer(Owner).DoLoadProgress(Self, Stage, PercentDone, RedrawNow, R, Msg);
  86. end;
  87.  
  88.  

So my question is:  Should I make the January 2021 file look like the November 2019 file and recompile my Lazarus 2.0.10 IDE ?

« Last Edit: January 19, 2021, 09:27:20 pm by RedOctober »

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: TPageControl not showing all tabs
« Reply #25 on: January 19, 2021, 10:53:24 pm »
Looking at svn diffs I am rather sure that the changes that you mention are intentional. In the old version (Nov 19) scaling is always executed even if the LCL scaling option is turned off in the project options. This was the reason for the changes in the newer version.

IIRC, the {$IF LCL_Fullversion >= 1080000} condition was removed because I had checked compilation and had found that JVCL does no longer compile when Laz is older than v1.8.0, and therefore the {$IF} condition is automatically fulfilled.

RedOctober

  • Sr. Member
  • ****
  • Posts: 450
Re: TPageControl not showing all tabs
« Reply #26 on: January 20, 2021, 09:35:12 am »
Ok, so, if I understand correctly, I am to leave the newer file (January 2021) alone, and use it for my project(s) going forward?  You are saying the changes you made in the older (Nov 2019) file, were accounted for, and just handled in a different (perhaps better) way in the (January 2021) file?

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: TPageControl not showing all tabs
« Reply #27 on: January 20, 2021, 11:03:00 am »
yes

 

TinyPortal © 2005-2018