Page 1 of 1
Display of individuals in result set
Posted: 15 May 2023 10:02
by jelv
In FH preferences, records window there is an option Display individuals surname first in main list.
Is there an option to have that when a column of a result set is an individual pointer?
I've coded round it by building another column with the name formatted as wanted and having the individual pointer as a buddy column, but it would be preferable if it could appear with the individual icon and so immediately appear as an openable links to the individuals.
If not wonder if we should ask for something like:
fhOverridePreference('SURNAME_FIRST', true, true)
PS The same issue occurs when creating queries.
Re: Display of individuals in result set
Posted: 15 May 2023 10:50
by tatewise
No John, there is no existing feature like that.
You are using the techniques described in the FHUG KB
An Overview of Queries under
Sorting a Fact Query on Owner Surname and its Plugin equivalent.
Would it be more generally useful to display the record icon whenever any
Buddy record item is used?
That would apply to both Query and Plugin Result Sets, and for any type of Record.
I'm not sure that the fhOverridePreference(...) that you suggested would work.
I have experimented with fhOverridePreference('SURNAMES_UPPERCASE',true,false) and it only applies to displays produced while the Plugin is running. It does NOT apply to Individual record Names in a Result Set produced by the Plugin after the Plugin has closed.
Re: Display of individuals in result set
Posted: 15 May 2023 13:08
by jelv
Mike, you got the option the wrong way round, it should be
fhOverridePreference('SURNAMES_UPPERCASE',true,true)
and it does result in the surnames being in upper case in the result set so maybe my suggestion could work. Just capitalising the surname doesn't help if you want to use it as a sort column in surname order; you still need extra hidden sort column(s).
Although I have it set to false at the beginning of the plugin, I inserted the code above just before fhOutputResultSetTitles where I start creation of the result set.
I hadn't thought about displaying the appropriate icon whenever a buddy column is used. Although it wouldn't be as simple to program (either in plugins or queries), it would give the display wanted and be a lot more flexible.
Re: Display of individuals in result set
Posted: 15 May 2023 13:37
by jelv
I have found a cheat to make the display look better:

- Record type icons.png (5.68 KiB) Viewed 429 times
Code: Select all
fhOutputResultSetColumn('Id', 'integer', gtblIssues.tblId, rows, idWidth, 'align_right', 2, true, 'default')
fhOutputResultSetColumn('', 'item', gtblIssues.tblIndiPtr, rows, 1, 'align_left', 0, true,'default')
fhOutputResultSetColumn('Individual', 'text', gtblIssues.tblIndiName, rows, 140, 'align_left', 1, true)
fhOutputResultSetColumn('IndiPtr', 'item', gtblIssues.tblIndiPtr, rows, 10, 'align_left', 0, true,'default', 'buddy')
The second line is the trick, it has the same content as the buddy line but with the column heading set to '' and the width as 1. Both the icon and the name can be clicked to open the individual.
Re: Display of individuals in result set
Posted: 15 May 2023 13:55
by tatewise
John, I think your analysis of my experiment is incorrect.
In Tools > Preferences > General the Display surnames in uppercase option is ticked (i.e. true) by default and is my setting.
So fhOverridePreference('SURNAMES_UPPERCASE',true,false) should force surnames to display in lowercase.
I deliberately chose the opposite of the Tools > Preferences > General setting to show if it was effective.
It does use lowercase if displayed within the Plugin by using say fhMessageBox( fhGetDisplayText(ptrIndi) )
But a Result Set created by the Plugin displays them according to the Tools > Preferences > General setting and changes immediately if that setting is changed. The fhOverridePreference(...) function has no effect on the Result Set.
If you have the default Tools > Preferences > General setting then fhOverridePreference('SURNAMES_UPPERCASE',true,true) is not changing anything so the experiment would prove nothing.
I used 'SURNAMES_UPPERCASE' because that is the only preference setting currently supported. I know it does not affect the SURNAME_FIRST feature.
Yes, your cheat technique mimics very closely how my proposed icon improvement would appear if implemented.
Re: Display of individuals in result set
Posted: 15 May 2023 14:59
by jelv
OK - I can confirm your analysis.
But here's a strange thing. If you turn Preferences, Records Window, Display individuals surnames first in main list off, when you go to the records window, clicking the Individual Records column heading to sort by that column still sorts by surname, not the name as displayed. Result sets and queries only give you given names first, but clicking the column heading sorts by the name as displayed. That seems inconsistent to me.
Perhaps what we need is for Display individuals surnames first in main list to apply to query and plugin result sets the same as Display surnames in uppercase?
Re: Display of individuals in result set
Posted: 15 May 2023 15:28
by tatewise
Yes, you are correct, that is a strange thing.
Certainly, it would be logical if the Display individual surnames first preference applied to all lists including Query and Plugin Result Sets.