Button highlighting?

BlitzMax Forums/MaxGUI Module/Button highlighting?

JoshK(Posted 2007) [#1]
I want to improve the ease-of-use of my applications with button highlighting and hotkeys on dialog boxes. I have the hotkey behavior worked out, but I can't seem to duplicate the highlighting that many windows programs use.

Here is the goto dialog in Windows Notepad. It is obvious to the user that pressing enter will press the OK button:


Here is my dialog, using BM_SETSTATE to highlight the button. The highlighting is just like what occurs when the button is pressed, but the outer blue edge is missing:


I don't want to actually activate the button, because the whole point of this is for the user to be able to open the dialog, alter most likely gadget they need to change, and hit enter without having to click on anything with the mouse.

More on buttons and BM_SETSTATE here:
http://msdn2.microsoft.com/en-us/library/ms673569.aspx

--EDIT--

Wow, there is a built-in BUTTON_OK flag to do exactly this! MaxGUI continually surprises me with little treats like this.

Any chance we can get a window style where pressing escape will close the window, for dialogs that don't have a cancel button? If I use SetHotKeyEvent it overrides cancel button, including those found in the message requesters.


EOF(Posted 2007) [#2]
Use the BUTTON_OK style.

Or ..

Not tested but does setting the buttons style with a WS_BORDER help?
Local style%=GetWindowLongA(hWnd,GWL_STYLE)
SetWindowLongA hWnd,GWL_STYLE,style|WS_BORDER