Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » RichText,QTF,RTF... » Issue with access keys positions
Issue with access keys positions [message #20499] Sat, 21 March 2009 05:10 Go to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
One of the first real issues I discovered in U++ that hasn't been fixed yet was the fact that you can't specify the position of an access key: "Zoom &Out" will highlight the first "o" in the text, not the third one.

Here is a possible fix for it. Not exactly the way I wanted it, but I did it this way so that only controls who specify a manual access key get affected by modified code and I also wanted to maintain backward compatibility.

Here is the general mechanism to implement access key positioning:
  • Attachment: LabelBase.h
    (Size: 4.62KB, Downloaded 363 times)
  • Attachment: LabelBase.cpp
    (Size: 12.91KB, Downloaded 328 times)
  • Attachment: Draw.h
    (Size: 44.21KB, Downloaded 366 times)
  • Attachment: DrawTextUtil.cpp
    (Size: 2.70KB, Downloaded 309 times)
Re: Issue with access keys positions [message #20500 is a reply to message #20499] Sat, 21 March 2009 05:12 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
...and a sample use of the code for Button:
  • Attachment: PushCtrl.h
    (Size: 10.55KB, Downloaded 350 times)
  • Attachment: Button.cpp
    (Size: 15.90KB, Downloaded 360 times)
Re: Issue with access keys positions [message #20531 is a reply to message #20500] Sun, 22 March 2009 11:12 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, that is reasonable, and initially I have used it, but later I was thinking and rather changed the code to use 'int' instead of 'byte' for accesskey and encode position in high-word. IMO it is more simple for adapting existing code and even to use.

Mirek
Re: Issue with access keys positions [message #20532 is a reply to message #20531] Sun, 22 March 2009 11:27 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
OK, should be fixed across the board....

One note:

In Zoom Out, 'O' would take precedence over 'o' now...

(But maybe some more coding would be nice, as during the 'distribution' 'o' in preceding item would spoil the fun. The correct would perhaps be to make two passes - one assigning upper letters, second lower for rest).

Mirek

Re: Issue with access keys positions [message #20533 is a reply to message #20532] Sun, 22 March 2009 12:26 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
Well this works also. I didn't want to change the meaning of the field. I planned this as intermediate stage towards having internationalized access keys, where I would extend also to an int storage. No use getting national keyboard if you can't use it to select items in menus Smile. If you stick other information in that int, it may make things harder. But 32 bits should be enough!

Tested and works fine. It's nice that there isn't a need to modify every widget to enable correct behavior.

cbpporter Issue #003: Accelerator keys are not properly aligned
Fixed

On to the next issue...
Re: Issue with access keys positions [message #20544 is a reply to message #20533] Sun, 22 March 2009 20:54 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
cbpporter wrote on Sun, 22 March 2009 07:26


Tested and works fine. It's nice that there isn't a need to modify every widget to enable correct behavior.



Actually, there was. Many had 'byte' field - that has to be changed to 'int'. Still easier than adding another field..

Mirek
Re: Issue with access keys positions [message #20545 is a reply to message #20533] Sun, 22 March 2009 20:55 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
cbpporter wrote on Sun, 22 March 2009 07:26



cbpporter Issue #003: Accelerator keys are not properly aligned
Fixed

On to the next issue...


P.S.: I see another issue lurking in TreeCtrl forum, I am not just capable today dealing with it Smile

Mirek
Previous Topic: RichText editor problem..
Next Topic: An escape function for QTF ?
Goto Forum:
  


Current Time: Thu Mar 28 10:59:07 CET 2024

Total time taken to generate the page: 0.01527 seconds