Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Limit which side to resize
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Limit which side to resize

 Post Reply Post Reply
Author
Message
Dmitry View Drop Down
Groupie
Groupie


Joined: 28 November 2004
Location: Australia
Status: Offline
Points: 31
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dmitry Quote  Post ReplyReply Direct Link To This Post Topic: Limit which side to resize
    Posted: 04 October 2005 at 11:29pm
Hi,

Is there a possibility to limit which side is allowed to be resized in CXTPDialogBar?

For example, i would like to only allow vertical resizing, but not horizontal. (In both docked and floating modes.)

If not, perhaps CXTPDialogBar::SetResizable can be enhanced to support an enum:

enum ResizeDirection
{
     RD_NONE = 0x0000,

           // resize one side only
     RD_LEFT = 0x0001,
     RD_RIGHT = 0x0002,
     RD_TOP = 0x0004,
     RD_BOTTOM = 0x0008,

           // resize two sides
     RD_HORIZONTAL = RD_LEFT | RD_RIGHT,
     RD_VERTICAL = RD_TOP | RD_BOTTOM,
     RD_BOTTOM_LEFT = RD_BOTTOM | RD_LEFT,
     RD_BOTTOM_RIGHT = RD_BOTTOM | RD_RIGHT,
     RD_TOP_LEFT = RD_TOP | RD_LEFT,
     RD_TOP_RIGHT = RD_TOP | RD_RIGHT,

           // resize three sides
     RD_LEFT_TOP_RIGHT = RD_LEFT | RD_TOP | RD_RIGHT,
     RD_LEFT_BOTTOM_RIGHT = RD_LEFT | RD_BOTTOM | RD_RIGHT,
     RD_TOP_RIGHT_BOTTOM = RD_TOP | RD_RIGHT | RD_BOTTOM,
     RD_TOP_LEFT_BOTTOM = RD_TOP | RD_LEFT | RD_BOTTOM,

           // resize everything (default)
     RD_ALL = RD_LEFT | RD_RIGHT | RD_TOP | RD_BOTTOM,
};

eg:

void CXTPDialogBar::SetResizable (ResizeDirection rd = RD_ALL);

Regards,
Dmitry                              
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 04 October 2005 at 11:54pm

You can create class from CXTPDialogBar and catch WM_NCHITTEST:

LRESULT CResizableDialogBar::OnNcHitTest(CPoint point)

{

...
}

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Dmitry View Drop Down
Groupie
Groupie


Joined: 28 November 2004
Location: Australia
Status: Offline
Points: 31
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dmitry Quote  Post ReplyReply Direct Link To This Post Posted: 05 October 2005 at 12:08am
Thanks Oleg.

ps: bol'shoye spasibo za bystriy otvet :)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.