View Full Version : Weird bug with tabbed axcontrol
02-04-2006, 03:43 PM
I hope its not a bug, and maybe we can find a work-around, but try this code out:
rollout testrollout "Test Tabs"
local tabnames = #("First", "Second", "Third")
activeXControl ax "MSComctlLib.TabStrip.2" height:200 width:25 pos:[0,1]
on testrollout open do
ax.placement = #tabplacementleft
ax.font.size = 7
for x = 1 to tabnames.count do
newtab = ax.tabs.add()
newtab.caption = tabnames[x]
Run it as is, then simply press enter on the keyboard with the dialog active. Nothing happens, as nothing should. Uncomment the cui.registerdialogbar and try the same test, although this time when you press enter, it activates the max tool zoomall tool! This is very annoying if you have a combobox or any other UI element that requires the user to input text and reflexively press enter afterwards, since it would call this tool at that point. Any thoughts?
Something with enableAccelerators()?
Unfortunately, it looks like a bug to me.
When you put focus on your dialogbar with a tab control, pressing enter always enables the Zoom tool. I assume that for some reason, whenever the focus is switched to the UI, the Zoom tool becomes the default tool or something like that.
Try this: Click the Play icon to start scene playback. Click again to stop. Now press Enter - playback starts again. Press Enter again - it stops. Do the same with the Next Frame >> button.
So while it is not obvious, certain icons in the UI can get into focus and then Enter operates on them. So it looks like switching focus to the dialogbar with the AX control does just this with the Zoom button for some reason...
Worth reporting as a bug I guess. If I find a workaround, will let you know.
enableAccelerators = false does not help as far as I can tell...
02-04-2006, 11:30 PM
I hoped it wasn't, but I guess it was. Instead of completely changing the UI of the tool I'm working on, I've opted to use an edittext element in conjunction with a listbox, instead of the combobox. Its not as neat, but it works -- the user can safely press enter after entering text into an edittext element without calling the max tool zoomall, then I can parse the entry to the listbox.
I think I've also found a bug having to do with an rcmenu in the same dialog! I haven't looked into it further, but whenever I click on the second menuitem of the third submenu, it pulls up the Spacing Tool along with executing my code. I've covered it up by placing an unclickable separator which just so happened to make sense in the menu at that location, but it still irks!
02-04-2006, 11:30 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.