Friday, May 08, 2026

Horizontal scolling

I haven't blogged much recently, primarily because there hasn't been much to blog about, but also because quite often I get struck by a mysterious malaise that hits at around 2 pm and only dissapates in the evening. I had a gastroscopy test at the beginning of the week whose conclusions were unclear; I don't have anything seriously wrong, but still. On the topic of health, I can report that since starting the new prophylactic medicine1 for migraines, I have been mercifully free of headaches, but there have been other side effects, such as adding 3 kg to my weight! And now for today's topic: horizontal scrolling.

In the OP's management program, there is a very simple form that has exactly one visible component, a TDBGrid. The grid's datasource is a query that has three fields: a date, a subject and a hidden id field. The subject can be very long and so it can be wider than the width of the form. Both the form and the grid have their bidimode set to biRightToLeft, as it should be for a Hebrew form. When one double clicks on the grid in order to open a form that is dependent on the hidden id field, the grid scrolls horizontally all the way to the left, thus effectively hiding the date field. A user complained that she had to scroll all the way to the right in order to overcome this.

I admit that I've seen this problem before but haven't cared enough to fix it. I also didn't know how to repair it. I assume that the solution would be some message that is sent to the grid to make it scroll back to the right. According to CoPilot, When a TDBGrid is in Right‑To‑Left mode: The visual left edge is actually the logical right edge. The scrollbar is reversed. When the grid receives focus again (after your double‑click opens the EditTask form), Windows sends a WM_HSCROLL message. The default handler scrolls the grid to the logical left, which in RTL mode is the visual right. But Delphi’s RTL support is partial, and the grid ends up scrolling to the visual left instead — exactly the opposite of what you want. So after returning from the EditTask form, the grid scrolls to the wrong side.

The fix seems to be to send the WM_HSROLL message to the grid (as I assumed): DBGrid1.Perform (WM_HSCROLL, SB_RIGHT, 0). But this code actually sends the cursor to the left of the grid (as I see it), whereas I want it to go to the right. So the real fix is DBGrid1.Perform (WM_HSCROLL, SB_LEFT, 0). And this does work.

Internal links
[1] 2095



This day in blog history:

Blog #Date TitleTags
7208/05/2007(Welcome to the) Hotel CaliforniaVan der Graaf Generator, Randy Newman, Jackson Browne, CSN, Barney Hoskyns
13008/05/2008Amsterdam diaryProgramming, Holiday, Amsterdam
35708/05/2011More facts your mother never told you about Word automationProgramming, Office automation
58108/05/2013Analysing my sleepCPAP, Gadgets
70408/05/2014Doctoring, researching, samplingDBA, Kindle
150008/05/20221500 blogsMeta-blogging
175708/05/2024Milano: the final dayComputers, Holiday, Italy, Milan

Saturday, May 02, 2026

Chamber music concert

I mentioned in a rather off the cuff manner a few months ago that 'there was supposed to be a chamber concert taking place in the kibbutz in another few hours' but that it was postponed because war with Iran had started that day. Finally, that chamber concert took place today and some of it was wonderful. 

The concert started with a short explanation about the harp as an instrument; this one had been built in the 1840s. The strings of a harp are tuned to a diatonic major scale, begging the question of how sharps and flats are played. It turns out that there are seven pedals at the bottom of the harp, where each pedal has three positions - flat, natural and sharp. This allows all the notes to be played, although sometimes enharmonics have to be employed, eg substituing F# for Gb. I know that Debussy wrote 'La fille aux cheveux de lin' (the girl with the flaxen hair) in the key of Gb which has six flats, so this must be a rather challenging piece to play.

The first piece of music to be played was Gabriel Fauré's 'Sicilienne' (Op. 78); the version that I am familiar with is played by cello and piano. There didn't seem to be much difference to the version played here by violin and harp, but this is always a good solid piece of music.

Next up was a real surprise as it wasn't in the pieces listed in the 'advert' for the concert - Debussy's 'Clair de lune' (the third part of the Suite Bergamasque). I wonder how the harp part was written as the music is notated in Db major with five flats. Surely it would be easier for both instruments simply to transpose the music up a semitone to D major - this would be a good key for the violin as well as two open strings, the D and A, are in this key. This was pure divine magic.

I have a memory of my mother saying that 'Clair de lune' was her favourite piece of music. Of course, I can't check with her as she passed away 24 years ago, and now it seems an odd statement for her to make as I don't have any recollection of her ever passing comment about a piece of music. I can't imagine any context in which she would have made this statement, either. But it is still a beautiful piece of music and the harp makes it more celestial than the piano does.

The other pieces on the set list were not familiar and I didn't enjoy them as much: a piece by Tchaikovsky that I can't name (a section from a violin concerto), Rumanian dances by Bartok, 'Fantasy for violin and harp' by Saint Saens (naturally I enjoyed this more). The final piece was probably part of 'Rapsodie espagnole' by Ravel (I didn't know that he was of Basque origin; I've always considered him to be French). I'm sorry to be so vague on the titles but I don't know the pieces and I'm having to transliteate their original names that were transliterated into Hebrew, so it's hard to be accurate.

The concert took place in a small building that one member turned into an art gallery. I was sitting in the second row on the left (I can recognise the bald patch on my head if I enlarge the picture) so of course the instruments were fairly loud, but they also had a large dynamic range as befitting top professional players.

Internal links
[1] 2083



This day in blog history:

Blog #Date TitleTags
17102/05/2009Heron - River of fortuneHeron
121302/05/2019DietHealth, Anaemia, Diet
175102/05/2024Menaggio in the rainHoliday, Italy, Varenna
193202/05/2025Maeve's songSong writing, Police procedurals