I need to make a view window active (by having the focus set to it). I am using the following code but it won't activate the window:
mdlView_setFunction (UPDATE_POST, viewUpdate);
Private int viewUpdate()
{
MSWindow *current;
int activeView,myView;
current =mdlWindow_getInputFocus();
for (current = mdlWindow_getFirst(); current;
current = mdlWindow_getNext(current)) {
mdlWindow_isView(&activeView, current);
if (activeView == myView) {
mdlWindow_setInputFocus(current, TRUE, FALSE);
break;
}
The mdlWindow_setInputFocus doesn't set the focus to my window. I know I have the right window because I can do
mdlWindow_hide and the right window will hide. So how can I get focus to it?
This line has no effect because you are changing the value of *current* in the for loop on the next line.
Also the variable *myView* is never initialized.
Dan
I think what you are looking for is IViewManager::GetManager().SetSelectedView(viewport, true, false)...
-B
Answer Verified By: rayjoslyn
error C2039: 'SetSelectedView' : is not a member of 'Bentley::DgnPlatform::IViewManager' This used to be valid but must have been depreciated with CONNECT. Anyone know what replaced it?
Did you ever figure this out I have a similar issue?
Yes (for my use anyway) here's the code:
IndexedViewSetR viewSet = IViewManager::GetActiveViewSet(); IndexedViewportP viewport = viewSet.GetViewport(view_number); viewSet.SetSelectedView(viewport, FALSE, FALSE);
Hi Cary,
Cary Hutchinson said:Did you ever figure this out I have a similar issue?
because this thread is over 3 years old, I recommend to ask in a new post and to specify properly what langauge and MicroStation version do you use. Things change quickly, so many issues discussed e.g. for original CONNECT Edition version have been solved in later updates or even do not exist today.
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point