user interface - Matlab plots directly inside c++ GUI -
i'm using matlab compiler generate c++ shared library m files. possible display matlab plots directly inside c++ gui (not in separate window) ?
i found easy solution. if using windows setparent matlab window. this.
hwnd h = findwindow(l"sunawtframe", l"figure 1"); void matlabviewerhack::embedmatlabplot(hwnd h) { setwindowpos(h,null,rect.left(), rect.top(), rect.width(), rect.height(),0); setwindowlong(h, gwl_style,ws_child|ws_visible); setparent(h, parent_widget); //dynamic_cast<qwidget*>(parent())->winid() //updating ui_state, windows xp, window 7 sendmessage(h, wm_updateuistate, uis_initialize, 0); sendmessage(parent_widget, wm_updateuistate, uis_initialize, 0); sendmessage(h, wm_changeuistate, uis_initialize, 0); sendmessage(parent_widget, wm_changeuistate, uis_initialize, 0); current_window = h; }
Comments
Post a Comment