Recent

Author Topic: [Solved!!!] Getting basic state-dependent properties for a component  (Read 3315 times)

heebiejeebies

  • Full Member
  • ***
  • Posts: 129
Re: Getting basic state-dependent properties for a component
« Reply #15 on: April 21, 2021, 03:08:22 pm »
Thanks everyone for the suggestions!  I already had the workaround which was showing the PopupMenu when clicking a button, but to me (At least for my purposes) it looks clunky and non-standard.  Lucamar nailed it - I need a TCombobox with style set to csDropdownlist.  That works perfectly for me - I can't edit it at all?  Hope it is the same for my users.   %)  I'll try it anyway and see how it goes.  Thanks everyone!
Fedora 38/Lazarus 2.2.4- FPC 3.3.1

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Getting basic state-dependent properties for a component
« Reply #16 on: April 21, 2021, 05:35:47 pm »
Just testet with Laz 2.0.10 on LinuxMint 19.2 Cinnamon 64bit, works as expected there.

You're right. I re-tested and it works as it should. I must heve done something wrong the first time ... like forgetting to set the correct Style :-[

Hope it is the same for my users.

It should; to pay for my carelessnes I tested both Windows (32 bit) and Linux (32/64 bits) and it worked correctly everywhere. Sorry about the previous "noise" :-[ :-[
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.

heebiejeebies

  • Full Member
  • ***
  • Posts: 129
Re: Getting basic state-dependent properties for a component
« Reply #17 on: April 22, 2021, 06:19:37 am »
No problems at all, thanks heaps for finding the right component - I'd never have found it!  :D
Fedora 38/Lazarus 2.2.4- FPC 3.3.1

heebiejeebies

  • Full Member
  • ***
  • Posts: 129
Re: Getting basic state-dependent properties for a component
« Reply #18 on: April 22, 2021, 10:14:31 am »
Btw just for any future Googlers, in answer to the initial question, it seems that, yes, typing the component name followed by a dot in the script editor does bring up all the relevant properties and procedures that can be applied to that component.  In this case, the original property that I was looking for was simply the Caption.  With a TComboBox, whatever the user selects becomes the caption. Easy  :D
Fedora 38/Lazarus 2.2.4- FPC 3.3.1

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Getting basic state-dependent properties for a component
« Reply #19 on: April 22, 2021, 11:21:36 am »
In this case, the original property that I was looking for was simply the Caption.  With a TComboBox, whatever the user selects becomes the caption. Easy  :D

Rather than Caption, for a combo box I'd recommend you read the Text property. Though both will, probably, return the same.
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