Recent

Author Topic: Compiler - What should I do ?  (Read 968 times)

davidh

  • New member
  • *
  • Posts: 9
Compiler - What should I do ?
« on: December 01, 2020, 03:57:48 pm »
Hello Guys and Gals,
I have a Lazarus form on which I have a tab in which I have data entry for the program I am writing. Now, I have two
TEdits which I wish to place outside the tab as the data they collect will apply to all the tabs. When I place the two Tedits on the form and compile, everything dissapears except the two fields on the form. I know I must be doing something wrong but what?

Best Wishes
David

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Compiler - What should I do ?
« Reply #1 on: December 01, 2020, 04:12:48 pm »
I think you need to post compilable code, since it is not clear whether your edits should be on a separate modal form, or on, say, a separate panel alongside the tabbed control (pagecontrol?);
 or covering it, but made visible/invisible by some means.

davidh

  • New member
  • *
  • Posts: 9
Re: Compiler - What should I do ?
« Reply #2 on: December 01, 2020, 05:02:25 pm »
Hi, and thanks for your quick response. I would be embarrased to post my code as it isn't near finished. Perhaps I didn't explain properly. When I run the program without the 2 tedits I get a correct appearance. However, when I recompile the same code but with two text boxes placed on the form above the tab ( on the form ) I get just the two tedits - nothing else. Everything else disappears. Two new clips attached
cheers

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11453
  • FPC developer.
Re: Compiler - What should I do ?
« Reply #3 on: December 01, 2020, 05:23:01 pm »
If I understood correctly, you put the edit boxes on the main form "under" the tabbed area and that causes paint problems.

Put them in the tab. Within a form it is all about visual rather than logic hierarchy.

AL

  • Sr. Member
  • ****
  • Posts: 264
Re: Compiler - What should I do ?
« Reply #4 on: December 01, 2020, 08:29:03 pm »
Put a panel on your form adjust its size to the top region.
Put a second panel that will be anchored to the top panel and that cover the rest of the form.
Place your 2 edits in the top panel.
Place you tab in the bottom panel.
Everything should show.
 
Laz 3.1, fpc 3.2.2, Win10
Laz 3.1  fpc 3.2.2, MacOS Monterey running on VMWare/Win 10
Laz 3.1  fpc 3.2.2 Ubuntu 20.04

davidh

  • New member
  • *
  • Posts: 9
Re: Compiler - What should I do ?
« Reply #5 on: December 01, 2020, 10:46:28 pm »
Thanks Al, That worked perfectly. Thank you very much  :P

davidh

  • New member
  • *
  • Posts: 9
Re: Compiler - What should I do ?
« Reply #6 on: December 01, 2020, 10:48:09 pm »
Thanks Marcov, for your help

Best Wishes
David

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Compiler - What should I do ?
« Reply #7 on: December 02, 2020, 12:17:11 am »
Put a panel on your form adjust its size to the top region.
Put a second panel that will be anchored to the top panel and that cover the rest of the form.

No need for the second panel or explicit anchors; a TPageControl (or similar) with Align set to alClient should do nicely, after the first panel with the two edits is aligned to alTop.

Something like the attached image, only it's a little more complex because the panel (buttons) on the right. It has a panel (the black one) aligned to alTop, the panel with buttons alined to alRight and a TListBox aligned to alClient ... not to mention the status bar at alBottom ;)
« Last Edit: December 02, 2020, 12:24:16 am by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018