Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
Embedding a window causes OI to hang
I am trying to embed a simple form into the shortcutbar on the create event. If I embed just a form with no controls then I'm all ok.
As soon as I add a control, any control to the form, the embed method doesn't seem to work.
By that I mean, the form remains visible in front of the parent rather than within the shortcutbar. It appears as if it moves it over the shortcutbar, albeit the wrong group but doesn't seem to quite complete the process.
In addition to that our generic create event for the parent window has some further processing to do and continues on. When this generic processing gets to the point of setting focus to one of its controls, OI just hangs and I have to kill it using task manager.
Any thoughts on why the embedding of the form won't work? I've set the raw style bits of the form as shown in the help and the form embeds when it is without controls. Add something as simple as a label though and it no longer works.
As soon as I add a control, any control to the form, the embed method doesn't seem to work.
By that I mean, the form remains visible in front of the parent rather than within the shortcutbar. It appears as if it moves it over the shortcutbar, albeit the wrong group but doesn't seem to quite complete the process.
In addition to that our generic create event for the parent window has some further processing to do and continues on. When this generic processing gets to the point of setting focus to one of its controls, OI just hangs and I have to kill it using task manager.
Any thoughts on why the embedding of the form won't work? I've set the raw style bits of the form as shown in the help and the form embeds when it is without controls. Add something as simple as a label though and it no longer works.
Comments
So the steps are
1. Start the parent window that contains the shortcutbar.
2. The create event (quickevent) calls a generic create routine.
3. The generic routine calls the commuter for the parent which does its thing, the last of which is:
Start_Window("MB_TEST", SBarCtrl$) hWnd = Get_Property("MB_TEST", "HANDLE") Send_Message(SBarCtrl$, "EmbedWindow", GeneralGroup$, hWnd)
4. It then returns to the generic create which has a few more things to do, one of which is
Set_Property(ctrlToGetFocus, 'FOCUS', 1)
The EmbedWindow method seems to move the new window over the shortcutbar but only after the above set_property focus call does it actually embed it into the desired group and then only if the window has no controls. If there are any controls on the WindowToBeEmbedded then OI just hangs on the Set_Property(ctrlToGetFocus, 'FOCUS', 1) call.
I just wanted to acknowledge your post and thank you for your diligent explanation of the issue. We will look into this as soon as possible (we are a bit preoccupied at the moment).
By the way, do you know if this had worked in a previous version of the SRP ShortcutBar? For that matter, what version are you using?
Thank you.
I've changed the approach to use the panel control for the form and the shortcutbar just for listing items. Initially I was going to embed the form into the first group of the shortcutbar so it could be collapsed out of the way (if embedded form groups are able to be collapsed?). The panel approach will suffice however so there's no rush on my part.
To answer your questions:
I haven't really used the shortcutbar though I experimented with it a couple of years ago. I thought I had had success with embedding a form with a datepicker control but I can't be sure. I do remember that we went with the tree control instead of the shortcutbar but I think I tried embedding a form with just a tree control into a shortcutbar and had similar issues to now. So I think I may have had it working in one instance but not another.
The version I'm using now is 3.0.1
This is still happening.
I did the 'raw style bits' thing. The problem is probably that we are using version 4.0.5
I will try to upgrade.
Thanks