Re: Reserving screen space on main frame
"tbandrowsky" <[email protected]>
| Newsgroups | gmane.comp.windows.wtl |
|---|---|
| Message-ID | <[email protected]> |
That's magnificent. Thank you! --- In [email protected], "Richard Crossley" <rdc@...> wrote: > > That sounds like you've modified the WTL frame class? If that's the case > then just add UpdateLayout() to your frame class deriving from the WTL frame > class and it will be called via the CRTP. > http://en.wikipedia.org/wiki/Curiously_Recurring_Template_Pattern > > Regards, > Richard. > > > -----Original Message----- > > From: [email protected] [mailto:[email protected]] On Behalf Of > > tbandrowsky > > Sent: 18 June 2009 23:39 > > To: [email protected] > > Subject: [wtl] Re: Reserving screen space on main frame > > > > Now I've noticed that UpdateLayout is not actually a virtual method. > > So, what I did was something like this: > > > > void UpdateLayout(BOOL bResizeBars = TRUE) > > { > > RECT rect = { 0 }; > > GetClientRect(&rect); > > > > UpdateBarsPosition(rect, bResizeBars); > > UpdateCustomFrameControlsPosition(rect); > > > > snip > > > > } > > > > virtual void UpdateCustomFrameControlsPosition(RECT& rect) > > { > > ; > > } > > > > Then I on hope to override it in my derived frame. > > > > > > > > > > > You can see how the WTL frame class does it by looking at its > > implementation > > > of Updatelayout(). > > > UpdateLayout() calls UpdateBarsPostion() to position the tool and > > status > > > bars then moves the client window to occupy the remaining space. > > > > > > All you need to do is provide an implementation of UpdateLayout() in > > your > > > frame class which moves the client and widget to the positions > > appropriate > > > for your layout. > > > > > > HTH, > > > > > > Richard. > > > > > > > -----Original Message----- > > > > From: [email protected] [mailto:[email protected]] On Behalf Of > > > > tbandrowsky > > > > Sent: 18 June 2009 20:20 > > > > To: [email protected] > > > > Subject: [wtl] Reserving screen space on main frame > > > > > > > > Hello. I am writing a WTL application and for whatever maddening > > > > reasons I have decided to not use the existing menu/toolbar > > structure > > > > and have my own navigation and toolbar in place instead. I > > understand > > > > how to not have items on the main window, by monkeying with > > OnCreate in > > > > MainFrm.h, but, what I would like to do is have my u/i in MainFrm > > > > reserve some space for its my custom widget, which it would draw, > > but > > > > then still have the view move correspondingly. > > > > > > > > I suppose I could brute force it by handling WM_SIZE, etc, but I > > notice > > > > that the existing frame seems to always have the view the right > > size, > > > > taking into consideration the other decorations. What do I need to > > do > > > > to have my widget play with MainFrame in the right way. What I'd > > > > really like to do, ultimately, is have mymainframe and menu be a > > single > > > > class so I can reuse the navigation for other projects and have a > > ready > > > > to go frame. > > > > > > > > > > > > > > > > > > > > ------------------------------------ > > > > > > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------ > > > > Yahoo! Groups Links > > > > > > > ------------------------------------ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/wtl/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/wtl/join (Yahoo! ID required) <*> To change settings via email: mailto:[email protected] mailto:[email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/