winapi - WM_NCCALCSIZE, custom client area, and scroll bars -
i have mfc app embeds scintilla text edit control. want customize scintilla control display custom controls next vertical scrollbar. essentially, want render controls in orange area below, green area represent scroll bars:
i tried overriding wm_nccalcsize message of scintilla window , subtracting offset right side of client rectangle. here code:
void cscintillactrl::onnccalcsize(bool bcalcvalidrects, nccalcsize_params* lpncsp) { cwnd::onnccalcsize(bcalcvalidrects, lpncsp); lpncsp->rgrc[0].right -= 100; }
however, causes vertical , horizontal scroll bars reposition account smaller client width, shown below:
i'm not sure if behavior caused scintilla or windows. there way can adjust client area , preserve positions of scroll bars?
i found scintilla specific solution. can use sci_setmarginright
command add margin right side of client area, , render controls inside that.
Comments
Post a Comment