Need to add anchoring/docking to legacy MFC dialog application -
i working mfc code believe developed in 90's. i've been given great task of bringing software 21st century, getting work on likes of windows 7/8. application targets numerous platforms, of 1 windows xp. original software had fixed window size , looks terrible on os. have managed overcome sizing dialog leaves lot of grey space. need incorporate anchors , docking, similar .net.
as always, time limited, need quick, "dirty" solutions, until time rewrite ui layer. application contains number of "screens", each following similar format. banner @ top, content consisting of copyright, on lhs , task buttons on rhs , kind of footer control containing "hotkeys".
as quick fix, thinking resizing dialog should cause following.
- banner anchored left , right
- lhs/rhs content split 60/40
- footer per banner
this made more difficult different controls used different target operating systems/platforms. basically, oninitdialog, uses conditional compilation to add controls, dynamically, depending on platform.
to implement guessing need following...
- each control "remembers" bounds expect tricky no wm_create message dialog child controls. possibly use onparentnotify.
- sizing dialog "remembers" last size , calculates differences in width , height. dialog sends parent resize message immediate children can re-calculate layout.
my question, finally, best way approach this? 1 idea have...
- introduce new widget class extends cwnd , returns anchor details via virtual method.
- create controls such cbanner, ccopyright, cfooter etc implement widget
- create rowwidget content sizes lhs , rhs content appropriately.
now hard put words! appreciated.
thanks
karl
actually common question , reasoning sound, rather reinventing wheel, might better first @ freely available implementations along lines describe.
for example this codeproject article think need.
Comments
Post a Comment