Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Possible to hide gripper?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Possible to hide gripper?

 Post Reply Post Reply
Author
Message
sbinder View Drop Down
Groupie
Groupie
Avatar

Joined: 22 November 2004
Location: Austria
Status: Offline
Points: 76
Post Options Post Options   Thanks (0) Thanks(0)   Quote sbinder Quote  Post ReplyReply Direct Link To This Post Topic: Possible to hide gripper?
    Posted: 26 November 2004 at 8:49am

Is it possible to hide the gripper of the commandbars (toolbar and menubar)?

How do you make the TOOLBARS (with icons) in the sample "CommandBarIcons"?



Edited by sbinder
Back to Top
Maye Johnson View Drop Down
Groupie
Groupie


Joined: 16 October 2004
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote Maye Johnson Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2004 at 6:11am
I have an app that has 2 status bars, but the one on top shouldn't have the resize gripper.  After tracing through the status bar creation code, I came up with the following work-around:


        // Check window style for WS_THICKFRAME and remove it if present.  This must be done because adding a second status bar to an app
        // that has a resizing border will add a resizing gripper to the status bar, which we don't want.  The call to CStatusBar::Create
        // calls CStatusBar::CreateEx, which in turn checks the parent's style for WS_THICKFRAME, and if present, adds the SBARS_SIZEGRIP
        // style.  By removing WS_THICKFRAME from the parent's style, creating the second status bar, then adding WS_THICKFRAME back to
        // the parent if it was present in the first place, we achieve our goal.
        bool    bThickFrame = false;
        if (GetStyle() & WS_THICKFRAME)
        {
            bThickFrame = true;
            ModifyStyle(WS_THICKFRAME, 0, 0);
        }
        if (!m_wndDebugStatusBar.Create(this) ||
            !m_wndDebugStatusBar.SetIndicators(g_deb ugStatusIndicators, sizeof(g_debugStatusIndicators) / sizeof(UINT)))
        {
            TRACE0("Failed to create debug status bar\n");
            return -1;      // fail to create
        }
        if (bThickFrame)
            ModifyStyle(0, WS_THICKFRAME, 0);


Back to Top
sbinder View Drop Down
Groupie
Groupie
Avatar

Joined: 22 November 2004
Location: Austria
Status: Offline
Points: 76
Post Options Post Options   Thanks (0) Thanks(0)   Quote sbinder Quote  Post ReplyReply Direct Link To This Post Posted: 29 November 2004 at 4:02am

Thanks!

I used

pToolBar->ModifyBarStyle(CBRS_GRIPPER,0);

for my Toolbar.

But I can't hide the gripper of the MenuBar.

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 30 November 2004 at 12:46am

it must work same:

pMenuBar->ModifyBarStyle(CBRS_GRIPPER,0);

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

Joined: 22 November 2004
Location: Austria
Status: Offline
Points: 76
Post Options Post Options   Thanks (0) Thanks(0)   Quote sbinder Quote  Post ReplyReply Direct Link To This Post Posted: 30 November 2004 at 4:11am

ModifyBarStyle()  is a memberfunction of CXTPToolbar, not of CXTPCommand.

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 30 November 2004 at 7:31am

pMenuBar must be CXTPMenuBar*;

CXTPMenuBar* pMenuBar = pCommandBars->SetMenu....

 

 

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

Joined: 28 June 2005
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote franji1 Quote  Post ReplyReply Direct Link To This Post Posted: 28 June 2005 at 8:04pm

In XTPro, the XTPToolbar::ModifyBarStyle signature appears to have a bug - here it is:

ModifyBarStyle(WORD dwRemove, DWORD dwAdd);

note that the hungarian notation is "dwRemove", but the actual type in the signature is WORD, not DWORD, hence any style that is beyond 0x10000 will NOT WORK (basically the same as dwRemove = 0x0000).

Guess what the value for CBRS_GRIPPER is - see XTPIncludes.h

#define CBRS_GRIPPER 0x00400000L

which is the same as a (WORD)0x0000.

we are building the .DLL under a different name so we CAN tweak the source (and not break anyone else).

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 03 July 2005 at 11:41pm

Hi,

It was fixed in previous versions. Update your sources.

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.063 seconds.