// JP opened flex table

Click to See Complete Forum and Search --> : Office 97 style menu/customizable toolbar sample


Bozo
April 21st, 1998, 05:20 PM
When using the precompiled DLL file and sample,

I get 2 bad behaviours:


1)Menu

The menu DOES NOT APPEAR AT ALL if the window is NOT maximized !

That means the menu appears (and works well) only if the window

is maximized.


2)Toolbar

The toolbar works in all cases, but:

a)When you customize the toolbar and throw away all icons at the left

of the drop-down list, then the bar height double without reason !!!

b)It does not remain at the position you set it to (it goes at a random pos ?)


I have the latest version of the sample (downloaded directly from the home page)

Anyone agree ?

Any fix ?

Stas Levin
April 23rd, 1998, 07:09 PM
Hi!


Thank you for your comments and bugs reporting!


1. Toolbar height problem can be fixed by changing the CBCGToolBar::WrapToolBar code.


Please replace the following lines of code in the file BCGToolBar.cpp, Ln 2630:


if (x + dx > nWidth)

{

if (pPrevButton != NULL)

{

pPrevButton->m_bWrap = TRUE;

x = 0;

y += m_sizeButton.cy + LINE_OFFSET;

nResult ++;

}


if (pButton->m_nStyle & TBBS_SEPARATOR)

{

// Don't show separator on the first column!

dx = 0;

}


To:


if (x == 0 && pButton->m_nStyle & TBBS_SEPARATOR)

{

// Don't show separator on the first column!

dx = 0;

}


if (x + dx > nWidth)

{

if (pPrevButton != NULL)

{

pPrevButton->m_bWrap = TRUE;

x = 0;

y += m_sizeButton.cy + LINE_OFFSET;

nResult ++;

}


2. Toolbar position after reloading problem.


Please change the line number 115 in the file MainFrame.cpp to


if (!m_wndUserToolBar.Create(this,

WS_CHILD | WS_VISIBLE | CBRS_BOTTOM | CBRS_HIDE_INPLACE,

AFX_IDW_CONTROLBAR_FIRST + 20)


The problem was that both "standard" and "user" toolbars where created with the same default ID.

//JP added flex table