Print Page | Close Window

Bug or command bar go crazy?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=2252
Printed Date: 08 November 2025 at 9:48pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Bug or command bar go crazy?
Posted By: mikexyz
Subject: Bug or command bar go crazy?
Date Posted: 18 May 2005 at 8:29pm
Hello:

I encounter this crazy behavior. On a same command bar, I create three custom button. The first button have mutiple selections of Line size (LIKE VISIO LINE SIZE). The second button have mutiple selections of Line Style (LIKE VISIO LINE STYLE). The third button have drop down list of icon, and selection like color select.

* NOTE: I took the code from one of the Codejock example for the 1st button & 2nd button.

The problem is when all three buttons in a same command bar, the LoadCommandBars(...) load bad result into First and Second Button.

------------------- EXAMPLE CODE ---------------------------------------

    CXTPToolBar* pFontBar;
    if (!(pFontBar = (CXTPToolBar*)pCommandBars->Add(_T("Font Bar"), xtpBarTop)) ||
        !pFontBar->LoadToolBar(IDR_EASY_FONT_BAR))
    {
        TRACE0("Failed to create font toolbar\n");
        return -1;
    }

    // Load the previous state for toolbars and menus.
    LoadCommandBars(_T("CommandBars")); <---------- CAUSE BAD INFORMATION LOAD UP

---------------------------------------------------------- -----------------------------------


But when I COMMENT this codes out. The First and Second button appear OK.

//------------------------ Draw Popup Link Line ------------------------
        if (lpCreateControl->nID == ID_EASY_LINK_LINE && pToolBar->GetBarID() == IDR_EASY_FONT_BAR)
        {
            lpCreateControl->controlType = xtpControlSplitButtonPopup;
            lpCreateControl->buttonStyle = xtpButtonIcon;      // only icon
            return TRUE;
        }
        //---------------------------------------------------------- ------------



Replies:
Posted By: Oleg
Date Posted: 19 May 2005 at 5:38am

It is strange. Try to comment LoadCommandBars,  run it and uncomment, may be it loads old state from registry.



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: mikexyz
Date Posted: 19 May 2005 at 10:14am
Oleg,

It is appear that information storage in the registry is not properly. This took several hours to track down this bugs.

Mike


Posted By: Oleg
Date Posted: 20 May 2005 at 7:55am
So the problem is gone now?

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: mikexyz
Date Posted: 20 May 2005 at 6:25pm
I work around the problem by comment out this:

LoadCommandBars(_T("CommandBars")); <---------- CAUSE BAD INFORMATION LOAD UP

Mike



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net