TMXOD Posted January 3, 2007 Posted January 3, 2007 Because I was bored, I took upon my little brother's challenge of creating a countdown for his birthday. The code runs fine, but I am having problems with a minor cosmetic feature: the text of the button that starts and stops the countdown timer changes depending on what clicking the button would do. When creating the button with GUICtrlCreateButton, I set the access key by adding the ampersand ('&') character before the key I want to set as the access key. I do the same when using GUICtrlSetData to change the button's text. The problem is that sometimes the underlining appears and sometimes it does not. Any Ideas? The entire source code (for context) is in the attached file, as the code is too long to post here. cdown.au3 Pictures for clarification: with underlining: without underlining: I've noticed that the underlining comes back when pressing the Alt key, but my Windows settings say to always display the access key, [sarcasm]so the problem must lie in AutoIt, as we all know that Windows has no bugs, right.... [/sarcasm] The problem occurs when the script is interpreted through AutoIt3.exe and when compiled with Aut2exe.exe. Can anyone else replicate the problem? if you can, post here, so I can have proof of the bug's existence when filing the bug report.
Richard Robertson Posted January 3, 2007 Posted January 3, 2007 Modifying access keys is not the safest thing to do. Even in Windows, modifying the shortcut hotkeys can cause leftovers and missing key presses.
TMXOD Posted January 3, 2007 Author Posted January 3, 2007 (edited) In this case, where the user interface is simple, and nothing but numbers are used for input, and the access key is changed for itself (from Start to Stop), the risk of missing keypresses is negligible. The fact of the matter is that it looks like AutoIt is at fault, given that I've made similar code to this in VB6, VB.NET, Java (both Swing and SWT), but not C/C++/C#(since GUI programming in these languages is painful), and Windows always showed the access key, even after changing the button text and the access key. Edited January 3, 2007 by DaProber
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now