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.

  1. banner anchored left , right
  2. lhs/rhs content split 60/40
  3. 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...

  1. each control "remembers" bounds expect tricky no wm_create message dialog child controls. possibly use onparentnotify.
  2. 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...

  1. introduce new widget class extends cwnd , returns anchor details via virtual method.
  2. create controls such cbanner, ccopyright, cfooter etc implement widget
  3. 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

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -