View Issue Details

IDProjectCategoryView StatusLast Update
0019470LazarusLCLpublic2011-06-26 10:01
ReporterSelzig HEMAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.31 (SVN)Product Build 
Target VersionFixed in Version0.9.31 (SVN) 
Summary0019470: '&' in StringGrid.Columns[x].Title.Caption
DescriptionHello,

& does not seem to work well in StringGrid.Columns[x].Title.Caption.
Please have a look at the attachement.
Same result with this code : stgrPR.Columns[2].Title.Caption:='&Code';

Regards. Gilles
TagsNo tags attached.
Fixed in Revision31338
LazTarget0.99.0
WidgetsetWin32/Win64
Attached Files

Activities

2011-06-03 17:42

 

screen.png (64,114 bytes)
screen.png (64,114 bytes)

Selzig HEM

2011-06-04 11:37

reporter   ~0048816

Same with TMenu. TmenuItem.Caption --> &Quit is displayed properly in the Object Inspector but the letter Q is not underlined in the item of the object.

Regards. Gilles

Vojtech Cihak

2011-06-04 12:16

reporter   ~0048819

Behaviour of StringGrid.Columns[x].Title.Caption is the same in Linux+Qt.

Visibility of &underlined characters of Captions in Menu on Windows are maybe related to desktop theme.

Jesus Reyes

2011-06-07 20:12

developer   ~0048929

The grid is custom drawn component, so even if we draw the shortcut correctly what would it suppose to do?

Selzig HEM

2011-06-09 11:48

reporter   ~0048986

Hello,

This is only a display problem. How to display a Columns[x].Title.Caption := '&code' with the same result as Label1.Caption := '&code'? Both are Captions. Why a different display ?
Same for the Tmenu.Items.

Regards. Gilles

Jesus Reyes

2011-06-11 02:18

developer   ~0049033

Last edited: 2011-06-11 02:19

Drawing a underlined char is not a problem, the problem is that a underlined char indicates it's a shortcut, if you press the shortcut what would it do?, IMO trying to put there a shortcut is misleading the user because it won't work.

The shortcut in a label has its purpose but in a grid what would it do?.

Selzig HEM

2011-06-12 12:02

reporter   ~0049058

Last edited: 2011-06-12 12:22

Hello,

I note that the display of captions is not standardized in Lazarus... and your reasoning is questionable : when I put one ('&Code') in a TLabel, it does not do more !... and yet the characters are properly displayed underlined.

My [ALT+C] triggers a display management of sub StringGrids, sorts a column (that of '&Code'), and gives focus to a TEdit... But that's my problem.

I try with Lazarus to make an ergonomic program fully controllable from the keyboard. To solve my display problem, I put a TLabel in the header of the column. It would be easier to use '&' in Column[].Title.Caption !

It seems curious that in an Object-Oriented Programming, 2 captions (that of a TLabel and that of a Column[].Title) work differently.

But it's a minor problem. I think we'll end this discussion. Still curious...

Regards.
Gilles

Vojtech Cihak

2011-06-12 13:41

reporter   ~0049062

With TLabel, you have property ShowAccelChar and you can decide if you want underlined character or not. You have also property FocusControl and after pressing Alt+something related component will be focused. But OnClick event of TLabel is not fired, this is difference to TButton, TCheckBox or others.
What should happen with header of column. OnHeaderClick ? Maybe useful.

Selzig HEM

2011-06-13 09:34

reporter   ~0049079

Hello,

Small point that may explain this misunderstanding: I drive my shortcuts from the Form (Keypreview := True + TForm.FormKeyDown) and not from each component (StringGrid...).
So for me, the '&' in Columns[].title.caption is really just a display problem.

Regards. Gilles

Jesus Reyes

2011-06-22 22:56

developer   ~0049314

I implemented an option in Column.Title.PrefixOption, with value poNone (default) it's the same behaviour as the current. with poHeaderClick it underlines the next char and checks for corresponding shortcut, on trigger it will call OnTitleClick for dbGrid or OnHeaderClick for the rest of grids. If you don't set the event, it shows the prefix anyway. Please test.

Selzig HEM

2011-06-25 16:25

reporter   ~0049395

Hello,

Tested with Lazarus 0.9.31-31370 fpc-2.4.4-20110625 : OK.
Thank you.

Regards. Gilles

Jesus Reyes

2011-06-25 18:36

developer   ~0049400

if it works for you, then please close this report.

Vincent Snijders

2011-06-25 19:26

manager   ~0049401

I set the status to resolved, so it can be closed by the reporter.

Issue History

Date Modified Username Field Change
2011-06-03 17:42 Selzig HEM New Issue
2011-06-03 17:42 Selzig HEM File Added: screen.png
2011-06-03 17:42 Selzig HEM Widgetset => Win32/Win64
2011-06-04 11:37 Selzig HEM Note Added: 0048816
2011-06-04 12:16 Vojtech Cihak Note Added: 0048819
2011-06-07 20:12 Jesus Reyes Note Added: 0048929
2011-06-07 20:23 Jesus Reyes Status new => assigned
2011-06-07 20:23 Jesus Reyes Assigned To => Jesus Reyes
2011-06-09 11:48 Selzig HEM Note Added: 0048986
2011-06-11 02:18 Jesus Reyes Note Added: 0049033
2011-06-11 02:19 Jesus Reyes Note Edited: 0049033
2011-06-12 12:02 Selzig HEM Note Added: 0049058
2011-06-12 12:04 Selzig HEM Note Edited: 0049058
2011-06-12 12:06 Selzig HEM Note Edited: 0049058
2011-06-12 12:06 Selzig HEM Note Edited: 0049058
2011-06-12 12:11 Selzig HEM Note Edited: 0049058
2011-06-12 12:18 Selzig HEM Note Edited: 0049058
2011-06-12 12:19 Selzig HEM Note Edited: 0049058
2011-06-12 12:22 Selzig HEM Note Edited: 0049058
2011-06-12 13:41 Vojtech Cihak Note Added: 0049062
2011-06-13 09:34 Selzig HEM Note Added: 0049079
2011-06-22 22:56 Jesus Reyes Fixed in Revision => 31338
2011-06-22 22:56 Jesus Reyes LazTarget => 0.99.0
2011-06-22 22:56 Jesus Reyes Status assigned => resolved
2011-06-22 22:56 Jesus Reyes Fixed in Version => 0.9.31 (SVN)
2011-06-22 22:56 Jesus Reyes Resolution open => fixed
2011-06-22 22:56 Jesus Reyes Note Added: 0049314
2011-06-22 22:56 Jesus Reyes Target Version => 0.99.0
2011-06-25 16:25 Selzig HEM Status resolved => assigned
2011-06-25 16:25 Selzig HEM Resolution fixed => reopened
2011-06-25 16:25 Selzig HEM Note Added: 0049395
2011-06-25 18:36 Jesus Reyes Note Added: 0049400
2011-06-25 19:26 Vincent Snijders Status assigned => resolved
2011-06-25 19:26 Vincent Snijders Resolution reopened => fixed
2011-06-25 19:26 Vincent Snijders Note Added: 0049401
2011-06-26 10:01 Selzig HEM Status resolved => closed