Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Bug or command bar go crazy?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Bug or command bar go crazy?

 Post Reply Post Reply
Author
Message
mikexyz View Drop Down
Newbie
Newbie
Avatar

Joined: 03 May 2005
Location: United States
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote mikexyz Quote  Post ReplyReply Direct Link To This Post Topic: Bug or command bar go crazy?
    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;
        }
        //---------------------------------------------------------- ------------


Edited by mikexyz
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: 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
Back to Top
mikexyz View Drop Down
Newbie
Newbie
Avatar

Joined: 03 May 2005
Location: United States
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote mikexyz Quote  Post ReplyReply Direct Link To This Post 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
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: 20 May 2005 at 7:55am
So the problem is gone now?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
mikexyz View Drop Down
Newbie
Newbie
Avatar

Joined: 03 May 2005
Location: United States
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote mikexyz Quote  Post ReplyReply Direct Link To This Post 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
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.062 seconds.