mysterious bug - or is it XP?!

Everything else that doesn't fall into one of the other PB categories.
sverson
Enthusiast
Enthusiast
Posts: 286
Joined: Sun Jul 04, 2004 12:15 pm
Location: Germany

mysterious bug - or is it XP?!

Post by sverson »

Now it's getting mysterious! :twisted:

The same exe behaves different depending on the way you call it!
Image Image
In both cases CheckBox1 is selected!
left: call from WindowsExplorer via EnterKey -> underlined letters and selection OK
right: call from WindowsExplorer via MouseLeftDblKlick -> underlined letters and selection NOT OK
[F5]/[F6] from PB-IDE or jaPBe works like call via EnterKey.

Code: Select all

If OpenWindow(0, 100, 100, 220, 170, #PB_Window_SystemMenu, "Tab Test") And CreateGadgetList(WindowID(0)) 
  If CreateMenu(0, WindowID())
    MenuTitle("&Project") 
    MenuItem(1, "&Open"   +Chr(9)+"Ctrl+O") 
    MenuItem(2, "&Save"   +Chr(9)+"Ctrl+S") 
    MenuItem(3, "Save &As"+Chr(9)+"Ctrl+A") 
    MenuItem(4, "&Close"  +Chr(9)+"Ctrl+C") 
  EndIf 
  StringGadget(0, 10, 10, 200, 20, "") 
  CheckBoxGadget(1, 10, 40,200, 20, "&CheckBox1")
  ButtonGadget(2, 10, 70, 200, 20, "Button&1") 
  StringGadget(3, 10, 100, 200, 20, "") 
  ButtonGadget(4, 10, 130, 200, 20, "Button&2") 
  ActivateGadget(0) 
  Repeat 
    Event = WaitWindowEvent() 
  Until Event = #PB_Event_CloseWindow 
EndIf 
End 
look here for more info on this subject
viewtopic.php?p=83062#83062

My system: WIN XP - PB 3.93

:wink: sverson
User avatar
Le Soldat Inconnu
Enthusiast
Enthusiast
Posts: 306
Joined: Wed Jul 09, 2003 11:33 am
Location: France

Post by Le Soldat Inconnu »

with theme XP, the underscore is only visible when you press ALT button
LSI
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

I'm 99% convinced that this is a XP issue.
msdn wrote:By pressing keys that correspond to the underlined letters in menus, commands, or dialog box options, you can quickly select options using the keyboard, rather than the mouse. You can also choose to hide underlined letters for keyboard navigation and input indicators (the dotted rectangles around objects) until you start using the keyboard to navigate in Windows, generally with the ALT, TAB or arrow keys. This procedure tells you how to select this option through Display Properties in Control Panel.
Seems that the Alt key is not doing it's job in XP when you...
1. have XP Skins enabled
AND
2. enable Hide underlined letters for keyboard navigation until I press the Alt key
AND
3. Use the mouse (rather than keyboard) for running the app.

I compiled sverson's test code to an .exe.

Double-clicking to run the .exe from Explorer, disables the focus rect and underlined letters.
Hi-lighting the .exe and pressing [Enter] to run the .exe, enables the focus rect and underlined letters.

I did the same routine with ApiViewer and the results were the same as above.

Conclusion: This is either a bug in XP or behavior by design in XP. I can't tell which it is. :?

Maybe this will help clear things up a little. http://blogs.msdn.com/saraford/archive/ ... 14935.aspx
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Thank you for the investigation Sparkie, it helps a lot as I wondered if PB did something wrong...
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

You're welcome Fred :-)

I don't normally use XP skins in my projects, but for my own knowledge I'd like to know how to make things work properly. Again, this only affects XP systems when you enable skins and Hide underlined letters.

I know we can use AddKeyboardShortcut, but the focus rect and underlining still won't work as expected for accelerated gadgets when pressing [Alt] key.

As an example, make sure the Hide underlined letters option is enabled in Display properties, then open Explorer Search using mouse clicks only, then press [Alt] and you'll see the underlined letters and focus rect appear.

It's my guess that in order for gadget accelerators to work as expected, we'll have to create our own Accelerator table. Is that correct :?:
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Post Reply