user interface - Implementing custom scrollbar WINAPI -
i'm designing gui framework. minimize window-to-window intenal os messaging, i'm implementing layout class logical rectangle manages windows , other layouts in way.
here structure
class uielement; //base class stuff class simplewindow:publioc uielement; //winapi window has hwnd class layout:public uielement{ public: std::vector<uielement> elements_list; virtual void manageelements()=0; } class columnlayout:public layout{ void manageelements()override; ...
on jpeg below can see visualization of general idea. layout class has "logical" ownership of child elements. in terms of windows api actual (hwnd) parent of windows in layout - parent window.
this layout system works fine on resizing , fitting 1 layout , parent windos i'm stuck @ implementing scrollbar functionality. idea should create derived class class layoutscrollable:public layout
, create custom scrollbar window contol (that easy do) on right side of , position rest of layout complex content on left side, channel change of scrollbar status child windows positions , clip away that's outside layout;
my first attempt clipping in wm_ncpaint callback. although clipped out area becomes hidden, still gets mouse messages , blocks mouse fall through underlying windows.
maybe should respond wm_nccalcsize , i'll try now. maybe knows other nice ways?
Comments
Post a Comment