Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
MARK ROBERTS
|
Jul 15, 2004 - 1:46 PM
|
Is it possible to have a maximize/ minimize button in a CExtControlBar window. My current requirement is to allow CExtControlbar to be maximize and fit to the whole parent window, similar to an MDIChild. and if I minimize will restore to last position it was in whether it was floating or docked.
|
|
Technical Support
|
Jul 16, 2004 - 1:12 PM
|
Dear Mark,
Please take a look at the CExtControlBar::OnNcAreaButtonsReinitialize virtual method in the ExtControlBar.cpp file:void CExtControlBar::OnNcAreaButtonsReinitialize()
{
INT nCountOfNcButtons = NcButtons_GetCount();
if( nCountOfNcButtons > 0 )
return;
NcButtons_Add( new CExtBarNcAreaButtonClose(this) );
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
NcButtons_Add( new CExtBarNcAreaButtonAutoHide(this) );
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
// NcButtons_Add( new CExtBarNcAreaButtonExpand(this) );
NcButtons_Add( new CExtBarNcAreaButtonMenu(this) );
} The commented line inserts the minimize/maximize button to the resizable bar’s caption. So, create a CExtControlBar -derived class and override this method (you need to uncomment this line).
|
|
Saroj Acharya
|
Aug 19, 2004 - 3:55 PM
|
Does this method really work ? I tried this and I did not get the Min/Max button in my CExtControlBar window. Please see the following code(mine): void CImageCaptureWndView::OnNcAreaButtonsReinitialize() { CExtControlBar::OnNcAreaButtonsReinitialize(); NcButtons_Add( new CExtBarNcAreaButtonExpand(this) ); }
|
|
Technical Support
|
Aug 20, 2004 - 12:50 PM
|
Dear Saroj,
It seems your source code should look like this:
void CImageCaptureWndView::OnNcAreaButtonsReinitialize()
{
INT nCountOfNcButtons = NcButtons_GetCount();
if( nCountOfNcButtons > 0 )
return;
NcButtons_Add( new CExtBarNcAreaButtonClose(this) );
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
NcButtons_Add( new CExtBarNcAreaButtonAutoHide(this) );
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
NcButtons_Add( new CExtBarNcAreaButtonExpand(this) );
NcButtons_Add( new CExtBarNcAreaButtonMenu(this) );
}
|
|
Neville Franks
|
Jul 15, 2004 - 1:21 AM
|
Hi, I mentioned a problem a few weeks back where a toolbar combo becomes hidden when it shouldn’t and you asked for an example. You can download the latest Surfulater Beta from www.surfulater.com/setupsurfulater1010.zip If you drag the right hand toolbar to the left a little you will see the combo in the left hand toolbar become hidden. You can use get this to happen in other ways like resizing the app window.
|
|
Technical Support
|
Jul 16, 2004 - 6:01 AM
|
Dear Neville,
Thank you for the bug report. The unwanted resizing was caused by incorrect calcualtion of the toolbar’s minimum horizontal width and vertical height. Please update the following code in the ExtToolControlBar.cpp file:CSize CExtToolControlBar::_CalcDesiredMinOuterSize( BOOL bHorz )
{
ASSERT_VALID( this );
if( m_bPaletteMode )
return CalcFixedLayout( FALSE, bHorz );
CSize sizeDefButton = _GetDefButtonSize();
CSize _size( 0, 0 );
if( m_pRightBtn != NULL )
{
CClientDC dc( this );
CFont * pOldFont =
dc.SelectObject(
OnGetToolbarFont(
( (!bHorz) && (!m_bPaletteMode) )
? true : false
)
);
CSize sizeTBBRight =
m_pRightBtn->CalculateLayout(
dc,
sizeDefButton,
bHorz //|| m_bPaletteMode
);
_size += sizeTBBRight;
if( bHorz )
_size.cx += __EXT_TB_BUTTON_INNER_MARGIN*2;
else
_size.cy += __EXT_TB_BUTTON_INNER_MARGIN*2;
dc.SelectObject( pOldFont );
}
// if( IsFloating() )
// return _size;
int nCountOfButtons = GetButtonsCount();
if( nCountOfButtons > 0 )
{
CSize _sizeAdjust( 0, 0 );
CClientDC dc( this );
CFont * pOldFont =
dc.SelectObject(
OnGetToolbarFont(
( (!bHorz) && (!m_bPaletteMode) )
? true : false
)
);
for( int nBtnIdx = 0; nBtnIdx < nCountOfButtons; nBtnIdx++ )
{
CExtBarButton * pTBB = _GetButtonPtr( nBtnIdx );
ASSERT_VALID( pTBB );
if( pTBB->IsSeparator() )
continue;
if( pTBB->GetStyle() & TBBS_HIDDEN )
continue;
if( nBtnIdx == (nCountOfButtons-1)
&& m_pRightBtn != NULL
)
{
ASSERT_VALID( m_pRightBtn );
ASSERT( m_pRightBtn == pTBB );
break;
}
CSize sizeTBB(
pTBB->CalculateLayout(
dc,
sizeDefButton,
bHorz
)
);
if( bHorz )
{
if( _sizeAdjust.cx > 0 )
_sizeAdjust.cx = min( _sizeAdjust.cx, sizeTBB.cx );
else
_sizeAdjust = sizeTBB;
}
else
{
if( _sizeAdjust.cy > 0 )
_sizeAdjust.cy = min( _sizeAdjust.cy, sizeTBB.cy );
else
_sizeAdjust = sizeTBB;
}
} // for( int nBtnIdx = 0; nBtnIdx < nCountOfButtons; nBtnIdx++ )
if( bHorz )
{
if( _sizeAdjust.cx > 0 )
_size.cx += _sizeAdjust.cx + __EXT_TB_BUTTON_INNER_MARGIN*2;
}
else
{
if( _sizeAdjust.cy > 0 )
_size.cy += _sizeAdjust.cy + __EXT_TB_BUTTON_INNER_MARGIN*2;
}
dc.SelectObject( pOldFont );
} // if( nCountOfButtons > 0 )
CRect rcClient, rcWindow;
GetClientRect( &rcClient );
GetWindowRect( &rcWindow );
if( bHorz )
_size.cx += rcWindow.Width() - rcClient.Width();
else
_size.cy += rcWindow.Height() - rcClient.Height();
return _size;
}
|
|
Finn Arildsen
|
Jul 14, 2004 - 2:04 PM
|
Thanks for your excellent framework. In general, I find it very easy to work with it. However, I have a problem with a checkbox on a toolbar. I create a CExtButton with the following style WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX and as the parent use a toolbar derived from CExtToolControlBar, then use SetButtonCtrl to position the control on the toolbar. This checkbox behaves terribly. 1) There is no box as such apparent, but if I click on the area, a check mark appears, then disappears correctly if I click again. 2) The check mark also disappears if I hover the cursor over the control. This is not correct behavior. Can you help me out of this trouble, i.e. tell me how I create a checkbox correctly. Thanks, Finn Arildsen PS: I think it is crucial that there is a visible box to put the check mark in, otherwise the user will never recognize this as a checkbox control.
|
|
Technical Support
|
Jul 15, 2004 - 2:10 AM
|
We sent you a test project by e-mail. Please take a look at the CMainFrame::CCheckBoxButton class. It should fit your requirements
|
|
miyoung bu
|
Jul 9, 2004 - 12:22 AM
|
In SimpleGrid application, I’d like to create a grid tab window dynamically... The problem is that the dynamically created grid tab can’t be activated programatically. Please inform me about how I can that... Sorry for my poor english!!
|
|
miyoung bu
|
Jul 9, 2004 - 2:51 AM
|
Please leave out the upper article which I wrote...
|
|
Wojciech Legierski
|
Jul 7, 2004 - 5:26 AM
|
Hi,
This problem appear when I move to version 2.25. When I choose different languge than Englis in my Dialog resource it doesn’t give effects - special fonts in dialog are not converted to my launguge fonts.
Thanks,
Wojtek
|
|
Technical Support
|
Jul 7, 2004 - 8:30 AM
|
Dear Wojtek,
To find the cause of the problem, we need some more details: the OS version and language, locales that were used in your test, and VC++ version.
|
|
Wojciech Legierski
|
Jul 8, 2004 - 2:43 AM
|
Hi,
I sent you my demo project with this problem. I am using VC++ 7.1 and WinXP Prof, polish version, and location is also polish.
Regards
Wojtek
|
|
Technical Support
|
Jul 9, 2004 - 5:55 AM
|
Dear Wojtek,
We think this is not a bug of Prof-UIS or your app. If you need to design a Polish dialog resource, add a new dialog and set its language to Polish. It is only then you can use Polish there. This relates only to Visual Studio IDE.
|
|
Saroj Acharya
|
Jul 4, 2004 - 10:51 AM
|
Gentlemen,
I had my application compiled using Prof_UI trial version 2.23. It was running OK except the location of my toolbars were not remembered properly. I looked into your website and realized that it was a bug and fix was available in V2.24+.
I recently purchased V2.25 and compiled my application with it in UNICODE. But, it gives an ASSERT fail when the following function is called: if( !CExtCustomizeSite::EnableCustomization( this ) )
Any suggestions ? I have attached the entire code of OnCreate() function of MainFrame.cpp file. Your advice for the fix would be highly appreciated. Thanks, Saroj -------------------------------------------------------------- int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; // Create the splash window and display the activities while the system is busy loading // configuration and other data
CSimpleSplashWnd _splash( this, IDB_BITMAP_SPLASH );
_splash.SetStatusText(_T("Initializing Optiview System...Please wait..."));
HINSTANCE hInstResource = AfxFindResourceHandle(MAKEINTRESOURCE( IDR_MAINFRAME ), RT_GROUP_ICON );
ASSERT( hInstResource != NULL );
HICON hIcon = (HICON)::LoadImage(hInstResource, MAKEINTRESOURCE( IDR_MAINFRAME ), IMAGE_ICON, 16, 16, 0 );
ASSERT( hIcon != NULL );
SetIcon( hIcon, FALSE );
CWinApp * pApp = ::AfxGetApp();
ASSERT( pApp != NULL );
hIcon = pApp->LoadIcon(IDR_MAINFRAME);
ASSERT( hIcon != NULL );
SetIcon( hIcon, TRUE );
ASSERT( pApp->m_pszRegistryKey != NULL );
ASSERT( pApp->m_pszRegistryKey[0] != _T(’\0’) );
ASSERT( pApp->m_pszProfileName != NULL );
ASSERT( pApp->m_pszProfileName[0] != _T(’\0’) );
ASSERT( pApp->m_pszProfileName != NULL );
g_CmdManager->ProfileSetup(pApp->m_pszProfileName, GetSafeHwnd() );
VERIFY(g_CmdManager->UpdateFromMenu(pApp->m_pszProfileName, IDR_MAINFRAME) );
VERIFY(g_CmdManager->UpdateFromMenu(pApp->m_pszProfileName, IDR_DRAWCLTYPE) );
VERIFY(g_CmdManager->UpdateFromMenu(pApp->m_pszProfileName, IDR_MENU_IMAGE_PROCESSING1) );
VERIFY(g_CmdManager->UpdateFromToolBar(pApp->m_pszProfileName, IDR_TOOLBAR_HELPER_ICONS) );
VERIFY(g_CmdManager->UpdateFromToolBar(pApp->m_pszProfileName, IDR_TOOLBAR_IMAGE_ROTATE) );
m_wndMenuBar.SetMdiWindowPopupName( _T("Window") ); if( !m_wndMenuBar.Create(NULL, this, ID_VIEW_MENUBAR) )
{
TRACE0("Failed to create menubar\n"); return -1; // failed to create
} if( !m_wndToolBarStandard.Create(NULL, this, AFX_IDW_TOOLBAR ) || !m_wndToolBarStandard.LoadToolBar(IDR_MAINFRAME) )
{
TRACE0("Failed to create standard toolbar\n"); return -1; // fail to create
}
// Create the list tree view and add dummy values
// **********************************************************************
m_wndResizableBarTree.SetInitDesiredSizeVertical(CSize( 200, 400 ) );
m_wndResizableBarTree.SetInitDesiredSizeHorizontal(CSize( 400, 200 ) ); if( !m_wndResizableBarTree.Create(NULL, this, ID_VIEW_RESIZABLEBAR_TREE) )
{
TRACE0("Failed to create m_wndResizableBarTree\n"); return -1; // fail to create
} if( !m_wndDockedCtrlTree.Create(
WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL
| TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT
| TVS_INFOTIP | TVS_DISABLEDRAGDROP
| TVS_SINGLEEXPAND | TVS_SHOWSELALWAYS
,
CRect(0,0,0,0),
&m_wndResizableBarTree,
m_wndResizableBarTree.GetDlgCtrlID()
)
)
{
TRACE0("Failed to create m_wndDockedCtrlEdit\n"); return -1; // fail to create
}
m_wndDockedCtrlTree.SetFont( CFont::FromHandle((HFONT)::GetStockObject(DEFAULT_GUI_FONT)) ); for( int nTreeIdx0 = 0; nTreeIdx0 < 10; nTreeIdx0++ )
{
CString sTreeItemText;
sTreeItemText.Format( _T("Item 1-%d"), nTreeIdx0+1 );
HTREEITEM htiAtLevel0 = m_wndDockedCtrlTree.InsertItem( LPCTSTR(sTreeItemText) );
ASSERT( htiAtLevel0 != NULL ); for( int nTreeIdx1 = 0; nTreeIdx1 < 5; nTreeIdx1++ )
{
sTreeItemText.Format( _T("Item 2-%d"), nTreeIdx1+1 );
HTREEITEM htiAtLevel1 = m_wndDockedCtrlTree.InsertItem( LPCTSTR(sTreeItemText), htiAtLevel0 );
ASSERT( htiAtLevel1 != NULL ); for( int nTreeIdx2=0; nTreeIdx2<3; nTreeIdx2++ )
{
sTreeItemText.Format( _T("Item 3-%d"), nTreeIdx2+1 );
HTREEITEM htiAtLevel2 = m_wndDockedCtrlTree.InsertItem( LPCTSTR(sTreeItemText), htiAtLevel1 );
ASSERT( htiAtLevel2 != NULL );
htiAtLevel2;
} // for( int nTreeIdx2=0; nTreeIdx2<5; nTreeIdx2++ )
} // for( int nTreeIdx1=0; nTreeIdx1<5; nTreeIdx1++ )
} // for( int nTreeIdx0=0; nTreeIdx0<10; nTreeIdx0++ )
// **********************************************************************
LPCTSTR strProfileName = g_CmdManager->ProfileNameFromWnd( GetSafeHwnd() );
ASSERT( strProfileName != NULL );
CExtCmdItem * pCmdItem = g_CmdManager->CmdGetPtr( strProfileName, ID_OBJECT_FILLCOLOR );
ASSERT( pCmdItem != NULL );
pCmdItem->StateSetPersistentIcon();
pCmdItem->m_nLParamUserData = (LPARAM)pCmdItem->m_nCmdID;
pCmdItem->StateSetColor();
pCmdItem->StateSetColorBtnDefault();
pCmdItem->StateSetColorBtnCustom();
pCmdItem->StateSetNoRotateVL();
pCmdItem = g_CmdManager->CmdGetPtr( strProfileName, ID_OBJECT_LINECOLOR );
ASSERT( pCmdItem != NULL );
pCmdItem->StateSetPersistentIcon();
pCmdItem->m_nLParamUserData = (LPARAM)pCmdItem->m_nCmdID;
pCmdItem->StateSetColor();
pCmdItem->StateSetColorBtnDefault();
pCmdItem->StateSetColorBtnCustom();
pCmdItem->StateSetNoRotateVL();
pCmdItem = g_CmdManager->CmdGetPtr( strProfileName, ID_DOC_LINE_WIDTH );
ASSERT( pCmdItem != NULL );
pCmdItem->m_sMenuText = _T("Line &Width");
pCmdItem->StateSetPersistentIcon();
INT nBtnIdx = m_wndToolBarStandard.CommandToIndex(ID_DOC_LINE_WIDTH);
ASSERT( nBtnIdx >= 0 );
CMenu _line_menu;
VERIFY( _line_menu.LoadMenu(IDR_MENU_LW) );
VERIFY( m_wndToolBarStandard.SetButtonMenu( nBtnIdx, _line_menu.Detach() ) );
CExtBarButton * pTBB = m_wndToolBarStandard.GetButton(nBtnIdx);
ASSERT_VALID( pTBB );
pTBB->SetNoRotateVerticalLayout();
pTBB->SetSeparatedDropDown();
pTBB->SetAutoChangeID();
pTBB->SetCmdID(ID_LINE_WIDTH_1, true); // set default effective command #if (defined __EXT_MFC_NO_CUSTOMIZE)
nBtnIdx = m_wndToolBarStandard.CommandToIndex(ID_OBJECT_FILLCOLOR);
VERIFY( m_wndToolBarStandard.RemoveButton(nBtnIdx, FALSE) );
CString sNoFill;
VERIFY( sNoFill.LoadString( IDS_STRING_NO_COLOR_FILL ) );
m_pBtnColorFill = new CExtBarColorButton( &m_wndToolBarStandard, ID_OBJECT_FILLCOLOR, 0, COLORREF(-1), RGB(0,0,0),
ID_OBJECT_FILLCOLOR, true, true, (LPCTSTR)sNoFill, NULL,
CExtBarColorButton::e_def_icon_type_t::__DIT_CHAR );
m_pBtnColorFill->SetSeparatedDropDown();
VERIFY( m_wndToolBarStandard.InsertSpecButton(nBtnIdx, m_pBtnColorFill, FALSE) );
nBtnIdx = m_wndToolBarStandard.CommandToIndex(ID_OBJECT_LINECOLOR);
m_wndToolBarStandard.SetButtonCtrlVisibleVertically( nBtnIdx, true );
VERIFY(m_wndToolBarStandard.RemoveButton(nBtnIdx, FALSE ));
CString sNoOutline;
VERIFY( sNoOutline.LoadString( IDS_STRING_NO_COLOR_OUTLINE ) );
m_pBtnColorOutline = new CExtBarColorButton( &m_wndToolBarStandard, ID_OBJECT_LINECOLOR, 0, COLORREF(-1), RGB(0,0,0),
ID_OBJECT_LINECOLOR, true, true, (LPCTSTR)sNoOutline, NULL,
CExtBarColorButton::e_def_icon_type_t::__DIT_FRAME
);
VERIFY( m_wndToolBarStandard.InsertSpecButton(nBtnIdx, m_pBtnColorOutline, FALSE) ); #endif // (defined __EXT_MFC_NO_CUSTOMIZE) if( !m_wndToolBarCustom.Create(NULL, this, ID_VIEW_TOOLBAR2 ) || !m_wndToolBarCustom.InitContentExpandButton() )
{
TRACE0("Failed to create custom toolbar\n"); return -1; // fail to create
} if(!AddImageProcessingToolBars1()) return(-1); if( !m_wndToolBarImageProcessing2.Create(_T("Image Processing Tools #1"), this, AFX_IDW_TOOLBAR ) ||
!m_wndToolBarImageProcessing2.LoadToolBar(IDR_TOOLBAR_IMAGE_PROCESSING)
)
{
TRACE0("Failed to create image processing toolbar\n"); return -1; // fail to create
} if( !m_wndToolBarImageProcessing3.Create(_T("Image Processing Tools #2"), this, AFX_IDW_TOOLBAR ) ||
!m_wndToolBarImageProcessing3.LoadToolBar(IDR_TOOLBAR_IMAGE_PROCESSING2)
)
{
TRACE0("Failed to create image processing toolbar\n"); return -1; // fail to create
} if( !m_wndToolBarAnnotation.Create(_T("Annotation Tools1"), this, AFX_IDW_TOOLBAR ) ||
!m_wndToolBarAnnotation.LoadToolBar(IDR_TOOLBAR_ANNOTATION)
)
{
TRACE0("Failed to create Annotation Tool1 toolbar\n"); return -1; // fail to create
} if( !m_wndToolBarAnnotation2.Create(_T("Annotation Tools2"), this, AFX_IDW_TOOLBAR ) ||
!m_wndToolBarAnnotation2.LoadToolBar(IDR_TOOLBAR_ANNOTATION2)
)
{
TRACE0("Failed to create Annotation Tool2 toolbar\n"); return -1; // fail to create
} // Add drop down menu items on the Rotate menu button // ******************************************************************************************
pCmdItem = g_CmdManager->CmdGetPtr( strProfileName, ID_IMAGE_ROTATE );
ASSERT( pCmdItem != NULL );
pCmdItem->m_sMenuText = _T("Image &Rotate");
pCmdItem->StateSetPersistentIcon();
INT nBtnRotateIdx = m_wndToolBarImageProcessing2.CommandToIndex(ID_IMAGE_ROTATE);
ASSERT( nBtnRotateIdx >= 0 );
CMenu _rotate_menu;
VERIFY( _rotate_menu.LoadMenu(IDR_MENU_IMAGE_ROTATE) );
VERIFY( m_wndToolBarImageProcessing2.SetButtonMenu( nBtnRotateIdx, _rotate_menu.Detach() ) );
CExtBarButton * pTBBRotate = m_wndToolBarImageProcessing2.GetButton(nBtnRotateIdx);
ASSERT_VALID( pTBBRotate );
pTBBRotate->SetNoRotateVerticalLayout();
pTBBRotate->SetSeparatedDropDown();
pTBBRotate->SetAutoChangeID();
pTBBRotate->SetCmdID(ID_IMAGE_ROTATE, true); // set default effective command to be 0 degree // ****************************************************************************************** // Add drop down menu items on the Rotate menu button // ******************************************************************************************
pCmdItem = g_CmdManager->CmdGetPtr( strProfileName, ID_IMAGE_PSEUDO_COLOR );
ASSERT( pCmdItem != NULL );
pCmdItem->m_sMenuText = _T("Image &Rotate");
pCmdItem->StateSetPersistentIcon();
INT nBtnPsuedoColorIdx = m_wndToolBarImageProcessing2.CommandToIndex(ID_IMAGE_PSEUDO_COLOR);
ASSERT( nBtnPsuedoColorIdx >= 0 );
CMenu _PsuedoColor_menu;
VERIFY( _PsuedoColor_menu.LoadMenu(IDR_MENU_PSEUDO_COLOR) );
VERIFY( m_wndToolBarImageProcessing2.SetButtonMenu( nBtnPsuedoColorIdx, _PsuedoColor_menu.Detach() ) );
CExtBarButton * pTBBPsuedoColor = m_wndToolBarImageProcessing2.GetButton(nBtnPsuedoColorIdx);
ASSERT_VALID( pTBBPsuedoColor );
pTBBPsuedoColor->SetNoRotateVerticalLayout();
pTBBPsuedoColor->SetSeparatedDropDown();
pTBBPsuedoColor->SetAutoChangeID();
pTBBPsuedoColor->SetCmdID(ID_IMAGE_PSEUDO_COLOR, true); // set default effective command to be 0 degree // ****************************************************************************************** static struct
{
UINT m_nCmdID;
LPCTSTR m_sToolbarText;
}
custom_toolbar_cmds[] =
{
{ ID_OBJECT_MOVETOFRONT, _T("Move to front") },
{ ID_OBJECT_MOVETOBACK, _T("Move to back") },
{ ID_SEPARATOR, NULL },
{ ID_OBJECT_MOVEFORWARD, NULL },
{ ID_OBJECT_MOVEBACK, NULL },
}; for(INT nCustBarIdx = 0; nCustBarIdx < sizeof(custom_toolbar_cmds)/sizeof(custom_toolbar_cmds[0]); nCustBarIdx++ )
{ // add buttons to custom toolbar
UINT nCmdID = custom_toolbar_cmds[nCustBarIdx].m_nCmdID; if( nCmdID != ID_SEPARATOR )
{
LPCTSTR sToolBarBtnText = custom_toolbar_cmds[nCustBarIdx].m_sToolbarText; if( sToolBarBtnText != NULL )
{
CExtCmdItem * pCmdItem = g_CmdManager->CmdGetPtr(strProfileName, nCmdID );
ASSERT( pCmdItem != NULL );
pCmdItem->m_sToolbarText = sToolBarBtnText;
} // if( sToolBarBtnText != NULL )
HICON hIcon = (HICON)::LoadImage(hInstResource, MAKEINTRESOURCE( nCmdID ), IMAGE_ICON, 16, 16, 0); if( hIcon != NULL )
{
VERIFY(g_CmdManager->CmdSetIcon( g_CmdManager->ProfileNameFromWnd(GetSafeHwnd()), nCmdID, hIcon, false) );
} // if( hIcon != NULL )
} // if( nCmdID != ID_SEPARATOR )
m_wndToolBarCustom.InsertButton( -1, nCmdID, FALSE );
} // add buttons to custom toolbar
m_wndPalette.m_bPaletteMode = true; if( !m_wndPalette.Create( NULL, this, ID_VIEW_PALETTE) || !m_wndPalette.LoadToolBar(IDR_TOOLBAR_HELPER_ICONS) )
{
TRACE0("Failed to create m_wndPalette toolbar\n"); return -1; // fail to create
}
m_wndPalette.GetButton(3)->SetWrap( CExtBarButton::__EVT_HORZ );
m_wndPalette.GetButton(8)->SetWrap( CExtBarButton::__EVT_HORZ );
m_wndPalette.GetButton(3)->SetWrap( CExtBarButton::__EVT_VERT );
m_wndPalette.GetButton(6)->SetWrap( CExtBarButton::__EVT_VERT );
m_wndPalette.GetButton(9)->SetWrap( CExtBarButton::__EVT_VERT );
m_wndPalette.GetButton(12)->SetWrap( CExtBarButton::__EVT_VERT );
m_wndPalette.GetButton(3)->SetWrap( CExtBarButton::__EVT_FLOAT );
m_wndPalette.GetButton(5)->SetWrap( CExtBarButton::__EVT_FLOAT );
m_wndPalette.GetButton(7)->SetWrap( CExtBarButton::__EVT_FLOAT );
m_wndPalette.GetButton(9)->SetWrap( CExtBarButton::__EVT_FLOAT );
m_wndPalette.GetButton(11)->SetWrap( CExtBarButton::__EVT_FLOAT );
m_wndStatusBar.m_bDrawPaneSeparatorsInsteadOfBorders = true; if( !m_wndStatusBar.Create(this, WS_CHILD|WS_VISIBLE|CBRS_BOTTOM|CBRS_HIDE_INPLACE) ||
!m_wndStatusBar.SetIndicators(indicators, sizeof(indicators) / sizeof(UINT))
)
{
TRACE0("Failed to create status bar\n"); return -1; // fail to create
}
m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBarStandard.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBarCustom.EnableDocking(CBRS_ALIGN_ANY);
m_wndPalette.EnableDocking(CBRS_ALIGN_ANY);
m_wndResizableBarTree.EnableDocking( CBRS_ALIGN_ANY );
m_wndToolBarImageProcessing1.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBarImageProcessing2.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBarImageProcessing3.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBarAnnotation.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBarAnnotation2.EnableDocking(CBRS_ALIGN_ANY);
// m_wndPanelDialog.EnableDocking(CBRS_ALIGN_ANY);
// ShowControlBar( &m_wndPanelDialog, FALSE, TRUE );
// m_dlgForPanelDialog.ShowSizeGrip( FALSE ); if( !CExtControlBar::FrameEnableDocking(this) )
{
ASSERT( FALSE ); return -1;
}
VERIFY(g_CmdManager->SetBasicCommands(pApp->m_pszProfileName, g_statBasicCommands) ); #if (!defined __EXT_MFC_NO_CUSTOMIZE)
VERIFY(CExtCustomizeSite::MenuInfoAdd( this, _T("Default"), IDR_MAINFRAME, true, false, RUNTIME_CLASS(CMainFrame)) );
VERIFY(CExtCustomizeSite::MenuInfoAdd( this, _T("Document"), IDR_DRAWCLTYPE, false, false, RUNTIME_CLASS(CMDIChildWnd), RUNTIME_CLASS(CView), RUNTIME_CLASS(CDocument)) );
VERIFY(CExtCustomizeSite::MenuInfoLoadAccelTable(_T("Default"), IDR_MAINFRAME) );
VERIFY(CExtCustomizeSite::MenuInfoLoadAccelTable(_T("Document"), IDR_MAINFRAME ) );
CExtCustomizeSite::MenuInfoGetByName( _T("Document") )
-> GetNode( true )
-> SearchNodeElement( _T("&Window"), 1 )
-> ModifyFlags( __ECTN_TBB_APPEND_MDI_MENU );
CExtCustomizeSite::MenuInfoGetByName( _T("Document") )
-> GetNode( false )
-> SearchNodeElement( _T("&Window"), 1 )
-> ModifyFlags( __ECTN_TBB_APPEND_MDI_MENU ); if( !CExtCustomizeSite::EnableCustomization( this ) )
{
ASSERT( FALSE ); return -1;
}
CExtCustomizeSite::CategoryUpdate( IDR_DRAWCLTYPE );
CExtCustomizeSite::CategoryUpdate( IDR_MENU_HELPER );
CExtCustomizeSite::CategoryUpdate( IDR_MAINFRAME );
CExtCustomizeCmdTreeNode * pObjectCategory = CExtCustomizeSite::CategoryGetTreeByName( _T("Object") );
ASSERT_VALID( pObjectCategory );
CExtCustomizeCmdTreeNode * pMenu = pObjectCategory->SearchNodeElement( ID_DOC_LINE_WIDTH );
ASSERT_VALID( pMenu );
VERIFY( pMenu->LoadMenuTree( this, this, IDR_MENU_LW ) );
pMenu->ModifyFlags( __ECTN_TBB_SEPARATED_DROPDOWN | __ECTN_TBB_AUTOCHANGE_ID | __ECTN_TBB_NO_ROTATE_VL );
pMenu->SetCmdID(ID_LINE_WIDTH_1, true); // set default effective command /*
pMenu = pObjectCategory->SearchNodeElement( ID_OBJECT_FILLCOLOR );
ASSERT_VALID( pMenu );
pMenu->ModifyFlags( __ECTN_AUTO_POPUP );
pMenu = pObjectCategory->SearchNodeElement( ID_OBJECT_LINECOLOR );
ASSERT_VALID( pMenu );
pMenu->ModifyFlags( __ECTN_AUTO_POPUP );
*/
CExtCustomizeSite::CategoryMakeAllCmdsUnique();
CExtCustomizeSite::CategoryAppendAllCommands();
CExtCustomizeSite::CategoryAppendNewMenu();
CExtCustomizeSite::CustomizeStateLoad( pApp->m_pszRegistryKey, pApp->m_pszProfileName, pApp->m_pszProfileName ); #endif // (!defined __EXT_MFC_NO_CUSTOMIZE) // Initialize Vision System class
CString szMsg;
szMsg.LoadString(IDS_OPTIVIEW_MSG_CREATING_STATUS_DISPLAY_PANES);
_splash.SetStatusText(szMsg);
AddLabelStatusBar(1);
AddProgressBarPane(2);
AddAnimatePanInStatusBar(3);
szMsg.LoadString(IDS_OPTIVIEW_MSG_VISIONSYSTEM_INITIALIZE); if(!InitializeVisionSystem()) return(-1); if( !CExtControlBar::ProfileBarStateLoad(this, pApp->m_pszRegistryKey, pApp->m_pszProfileName, pApp->m_pszProfileName, &m_dataFrameWP) )
{
DockControlBar( &m_wndMenuBar );
DockControlBar( &m_wndToolBarStandard );
DockControlBar( &m_wndToolBarCustom );
DockControlBar( &m_wndPalette );
DockControlBar( &m_wndToolBarImageProcessing1 );
}
g_CmdManager->SerializeState(pApp->m_pszProfileName, pApp->m_pszRegistryKey, pApp->m_pszProfileName, false ); #if (!defined __EXT_MFC_NO_TABMDI_CTRL) if( !m_wndMdiTabs.Create( this ) )
{
ASSERT( FALSE ); return -1;
} #endif // (!defined __EXT_MFC_NO_TABMDI_CTRL)
_splash.DestroyWindow(); return 0;
}
|
|
Saroj Acharya
|
Jul 5, 2004 - 11:09 AM
|
I debugged my code fuirther and found that the ASSERT is coming from the follwoing line of code :
OnRegisterToolBar()
|
|
Saroj Acharya
|
Jul 5, 2004 - 11:15 AM
|
Could not finsih my earlier post...The error is coming from
OnRegisterToolBar function of file extcustomize.cpp. To be exact, the following line produces the error:
// m_pNodeMenusI->InsertBarNode( this, pHelperBarButtons );
} // if( pToolBar->IsKindOf(RUNTIME_CLASS(CExtMenuControlBar)) ) else
{
UINT nCmdID = (UINT)pToolBar->GetDlgCtrlID();
pHelperBarButtonsI = OnCmdNodeCreate( nCmdID, nCmdID );
m_pNodeToolbarsI->InsertBarNode( this, pHelperBarButtonsI );
} // else from if( pToolBar->IsKindOf(RUNTIME_CLASS(CExtMenuControlBar)) )
|
|
Technical Support
|
Jul 5, 2004 - 11:26 AM
|
Dear Saroj
Please send us your test project so that we can quickly find the cause of the problem.
|
|
Saroj Acharya
|
Jul 3, 2004 - 12:09 PM
|
I Recently purchased Prof_UI V2.25 single user license. The installation and library build for all the files was successful. I then created a sample test application using Prof_UISAppWizard. By default it was using Multi-Byte Character Set and it compiled cand run OK. However when I tried to compile this project using Unicode character set, I got the following link errors: I would appreciate if you could look at these error messages and let me know what is going on. Thanks, Saroj _____________________________________________________________________________ Test2.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CExtPaintManager::PaintDatePickerPushButton(class CDC &,class CRect const &,long,wchar_t const *,bool,bool,bool,bool,class CObject *,long)" (?PaintDatePickerPushButton@CExtPaintManager@@UAEXAAVCDC@@ABVCRect@@JPB_W_N333PAVCObject@@J@Z) Test2.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CExtPaintManager::OnSettingChange(unsigned int,wchar_t const *)" (?OnSettingChange@CExtPaintManager@@UAEXIPB_W@Z) Test2.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CExtPaintManagerXP::PaintIcon(class CDC &,bool,class ATL::CStringT<wchar_t,class StrTraitMFC_DLL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > &,class CExtCmdIcon *,class CRect const &,class CRect &,bool,bool,bool,int)" (?PaintIcon@CExtPaintManagerXP@@UAEXAAVCDC@@_NAAV?$CStringT@_WV?$StrTraitMFC_DLL@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@PAVCExtCmdIcon@@ABVCRect@@AAV6@111H@Z) Test2.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CExtPaintManagerXP::PaintTabItem(class CDC &,class CRect &,bool,bool,bool,bool,bool,bool,bool,class CRect const &,class CSize,class CFont *,wchar_t const *,class CExtCmdIcon *,class CObject *,long)" (?PaintTabItem@CExtPaintManagerXP@@UAEXAAVCDC@@AAVCRect@@_N222222ABV3@VCSize@@PAVCFont@@PB_WPAVCExtCmdIcon@@PAVCObject@@J@Z) Test2.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall CExtCmdManager::ProfileSetup(wchar_t const *,struct HWND__ *,class CExtCmdProfile *)" (__imp_?ProfileSetup@CExtCmdManager@@QAE_NPB_WPAUHWND__@@PAVCExtCmdProfile@@@Z) referenced in function "public: void __thiscall CTest2App::SetupUiAdvancedOptions(void)" (?SetupUiAdvancedOptions@CTest2App@@QAEXXZ) Test2.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CExtWS<class CExtADLG<class CDialog>,301>::EnableSaveRestore(wchar_t const *,wchar_t const *,bool)" (?EnableSaveRestore@?$CExtWS@V?$CExtADLG@VCDialog@@@@$0BCN@@@UAEXPB_W0_N@Z) Test2.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall CExtWS<class CExtADLG<class CDialog>,301>::EnableSaveRestore(wchar_t const *,wchar_t const *,bool)" (__imp_?EnableSaveRestore@?$CExtWS@V?$CExtADLG@VCDialog@@@@$0BCN@@@UAEXPB_W0_N@Z) referenced in function "protected: virtual int __thiscall CAboutDlg::OnInitDialog(void)" (?OnInitDialog@CAboutDlg@@MAEHXZ) MainFrm.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall CExtCmdManager::SerializeState(wchar_t const *,wchar_t const *,wchar_t const *,bool)" (__imp_?SerializeState@CExtCmdManager@@QAE_NPB_W00_N@Z) referenced in function "protected: int __thiscall CMainFrame::OnCreate(struct tagCREATESTRUCTW *)" (?OnCreate@CMainFrame@@IAEHPAUtagCREATESTRUCTW@@@Z) MainFrm.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static bool __cdecl CExtControlBar::ProfileBarStateLoad(class CFrameWnd *,wchar_t const *,wchar_t const *,wchar_t const *,struct tagWINDOWPLACEMENT *)" (__imp_?ProfileBarStateLoad@CExtControlBar@@SA_NPAVCFrameWnd@@PB_W11PAUtagWINDOWPLACEMENT@@@Z) referenced in function "protected: int __thiscall CMainFrame::OnCreate(struct tagCREATESTRUCTW *)" (?OnCreate@CMainFrame@@IAEHPAUtagCREATESTRUCTW@@@Z) MainFrm.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall CExtCmdManager::SetBasicCommands(wchar_t const *,unsigned int *,bool)" (__imp_?SetBasicCommands@CExtCmdManager@@QAE_NPB_WPAI_N@Z) referenced in function "protected: int __thiscall CMainFrame::OnCreate(struct tagCREATESTRUCTW *)" (?OnCreate@CMainFrame@@IAEHPAUtagCREATESTRUCTW@@@Z) MainFrm.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall CExtCmdManager::UpdateFromMenu(wchar_t const *,unsigned int,bool,bool)" (__imp_?UpdateFromMenu@CExtCmdManager@@QAE_NPB_WI_N1@Z) referenced in function "protected: int __thiscall CMainFrame::OnCreate(struct tagCREATESTRUCTW *)" (?OnCreate@CMainFrame@@IAEHPAUtagCREATESTRUCTW@@@Z) MainFrm.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall CExtCmdManager::ProfileWndAdd(wchar_t const *,struct HWND__ *)" (__imp_?ProfileWndAdd@CExtCmdManager@@QAE_NPB_WPAUHWND__@@@Z) referenced in function "protected: int __thiscall CMainFrame::OnCreate(struct tagCREATESTRUCTW *)" (?OnCreate@CMainFrame@@IAEHPAUtagCREATESTRUCTW@@@Z) MainFrm.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static bool __cdecl CExtControlBar::ProfileBarStateSave(class CFrameWnd *,wchar_t const *,wchar_t const *,wchar_t const *,struct tagWINDOWPLACEMENT *)" (__imp_?ProfileBarStateSave@CExtControlBar@@SA_NPAVCFrameWnd@@PB_W11PAUtagWINDOWPLACEMENT@@@Z) referenced in function "public: virtual int __thiscall CMainFrame::DestroyWindow(void)" (?DestroyWindow@CMainFrame@@UAEHXZ)
|
|
Technical Support
|
Jul 5, 2004 - 8:10 AM
|
Dear Saroj,
There is a small bug in the declaration of the CExtPaintManager::PaintDatePickerPushButton method: the strCaption parameter should have __EXT_MFC_SAFE_LPCTSTR type instead of LPCTSTR . Thank you for your help.
|
|
Neville Franks
|
Jun 30, 2004 - 8:00 PM
|
Hi, On a fresh app install I have two toolbars I want to be docked side by side on the same row. eg. When "if( !CExtControlBar::ProfileBarStateLoad(...))" I have tried: DockControlBar( &m_wndToolBarSearch );
CExtControlBar* pECBSearchTBar = dynamic_cast<CExtControlBar*>( GetControlBar( IDR_SearchTBar ) );
pECBSearchTBar->DockControlBar( &m_wndToolBar, true, false, this ); // Does ASSERT( !IsFixedMode() );
but this a) ASSERT’s and b_ doesn’t work. I’ve also tried the other forms of DockControlBar(). Any suggestions? Thanks, Neville
|
|
Technical Support
|
Jul 1, 2004 - 9:09 AM
|
Dear Neville,
That code won’t work because the CExtControlBar::DockControlBar method can be used with resizable panels only. Instead, please use the CFrameWnd::DockControlBar method to dock any fixed-size control bar like toolbars, menu bars, or fixed-size panels. Here is an example of how you could position the menu bar at the top of the frame window and then dock two toolbars with it (in the next row): DockControlBar(&m_wndMenuBar);
DockControlBar(&m_wndToolBar);
RecalcLayout();
CRect wrAlredyDockedBar;
m_wndToolBar.GetWindowRect( &wrAlredyDockedBar );
wrAlredyDockedBar.OffsetRect( 1, 0 );
DockControlBar(&m_wndToolBar2,
AFX_IDW_DOCKBAR_TOP,&wrAlredyDockedBar);
|
|
Neville Franks
|
Jul 2, 2004 - 1:38 AM
|
Great, Thanks that works.
|
|
Neville Franks
|
Jun 30, 2004 - 7:30 PM
|
Hi, I’ve got a toolbar with just a built-in combo field button on it. When I position another toolbar beside it and reduce the width of the app frame window there is insufficent room to fully display both toolbars the combo field becomes hidden even though there is still plenty of room for it. If I mouse over the combo field it becomes visible again. Seems like a bug to me. :) Neville
|
|
Technical Support
|
Jul 1, 2004 - 8:53 AM
|
Dear Neville,
Could you send us a compiled version of your application. Please do not forget to describe the details: the operating system, compiler version, and service packs (if any).
|
|
Neville Franks
|
Jul 2, 2004 - 1:52 AM
|
I’ll have the next beta release of Surfulater available early next week and will let you know so you can download a copy. It will show this problem.
|
|
Neville Franks
|
Jun 30, 2004 - 3:39 PM
|
Hi, I’d like to be able to dock a toolbar beside the main menu bar and can’t get this to work. Is this possible and if so how? Thanks, Neville
|
|
Technical Support
|
Jul 1, 2004 - 8:23 AM
|
Dear Neville,
The menu bar is designed to occupy the full row or column and we treat such behavior of the menu line as generally accepted. But you can derive a class from the CextMenuControlBar and override the following internal virtual methods:virtual bool _GetFullRowMode() const;
virtual void _RecalcPositionsImpl();
virtual void _RecalcLayoutImpl();
Your implementation of these methods should invoke the methods with the same names as those in the CExtToolControlBar class. Besides you need to set CExtMenuControlBar::m_bMultiRowLayout to false in the constructor of your class. As a result, your menu bar will have the behavior of the toolbar and you can dock a toolbar beside it.
|
|
Neville Franks
|
Jul 2, 2004 - 1:42 AM
|
Thanks. I agree this not very standard and will leave it for now. I have a small menu in Surfulater and thought the user may want to make use of the space beside it. Maybe this can be done as an option in CextMenuControlBar in the future to save us having to derive yet another class. :-) Thanks, Neville
|
|
Neville Franks
|
Jun 30, 2004 - 1:26 AM
|
Hi, How do I programmatically set focus to a combobox on a toolbar. eg. In the StyleEditor sample how would I set focus to the Font Selection combo from code in my CMainFrame? Thanks, Neville
|
|
Technical Support
|
Jun 30, 2004 - 3:36 AM
|
Dear Neville,
First, you need to get a pointer to the CExtBarButton object which implements the button in toolbar (with the help of CExtToolControlBar::GetButton ). Then use the DYNAMIC_DOWNCAST macro to try and get a pointer to the CExtBarTextFieldButton object. If it is not NULL , the button is a text field or a combo field. Then activate the in-place editor by invoking the CExtBarTextFieldButton::OnInplaceControlRun method. Please do not forget to check whether the field button is visible (with CExtBarButton::IsVisible ).
|
|
Neville Franks
|
Jun 30, 2004 - 3:30 PM
|
>Please do not forget to check whether the field button is visible (with CExtBarButton::IsVisible ). Can you tell me how a toolbar button/combo can become !Visible? I’ve added: if ( !pEBB->IsVisible() )
pEBB->Show( true );
and even if I hide the toolbar with the combo button CExtBarButton::IsVisible() returns true. Thanks, Neville
|
|
Technical Support
|
Jul 1, 2004 - 7:54 AM
|
The CExtBarButton::ModifyStyle method allows you to forcibly make the button visible/invisible by setting/removing the TBBS_HIDDEN button style. The CExtBarButton::IsVisible method just returns true if the button is displayed inside toolbar’s client area or false if the button is temporarily hidden inside the chevron menu. You should not use the CExtBarButton::Show method because it is designed for the internal use only (it is used when the toolbar calculates a subset of visible buttons in its client area). To check the button’s visibility, do the following:
- check the toolbar’s visibility with the
CControlBar::IsVisible method: if the toolbar is not visible, you may show it by calling CFrameWnd::ShowControlBar method or sending the WM_COMMAND message with the dialog control identifier as WPARAM to the frame window
- if the toolbar is visible, check whether the TBBS_HIDDEN button style is excluded to ensure that the button can be "physically" visible
- check the button visibility with the
CExtBarButton::IsVisible method: if the button is not visible, then it is hidden in the chevron menu
|
|
Neville Franks
|
Jun 30, 2004 - 4:44 AM
|
Thanks for your help, I’ve got it working. Neville
|
|
Luis Alberto Pereira
|
Jun 29, 2004 - 10:31 AM
|
Dears, Can you tell me how can I handle the event click of close button in a CExtControlBar ? Thanks, Luis
|
|
Technical Support
|
Jun 30, 2004 - 2:39 AM
|
Dear Luis,
The buttons in the caption area of the resizable control bar are not the button controls because the caption is a non-client area (which does not contain child windows). Each button is an instance of a CExtBarNcAreaButton -derived class. The X button ("Close") is the instance of the CExtBarNcAreaButtonClose class. To handle the mouse-click event, create your own class derived from CExtBarNcAreaButtonClose . Your button should implement the OnNcAreaClicked virtual method. Please take a look at the code for the CExtBarNcAreaButtonClose::OnNcAreaClicked method in ExtControlBar.cpp for details. Besides you should create a CExtControlBar -derived class and override the OnNcAreaButtonsReinitialize virtual method to initialize the caption buttons. This overridden method should be similar to the original one but with your CExtBarNcAreaButtonClose derived type for initializing the X button.
|
|
Neville Franks
|
Jun 28, 2004 - 5:20 AM
|
Hi, When I click on a combo box on a toolbar it gets focus but the current text isn’t selected. The Prof-UIS ProfStudio sample does select the combo text. My code uses: pCmdItem = g_CmdManager->CmdGetPtr( pszUIRegKey, ID_SearchCombo );
pCmdItem->StateSetCombo();
pCmdItem->StateSetResizable();
pCmdItem->m_nTextFieldWidth = pCmdItem->m_nDropDownWidth = 100;
pCmdItem->m_nDropDownHeightMax = 116;
whereas the ProfStudio code uses CExtComboBox etc. I don’t know if this is relevant. So how do I get the combo text selected when the combo gets focus? I’m using Prof-UIS 2.24. Thanks, Neville
|
|
Technical Support
|
Jun 28, 2004 - 10:15 AM
|
Dear Neville,
Please let us know whether you use combo box windows with toolbar buttons or built-in combo field buttons?
|
|
Neville Franks
|
Jun 28, 2004 - 3:11 PM
|
Hi, I assume they are built-in combo field buttons. My code is similar to your StyleEditor sample and you can see this same issue with that program. ie. Click in any of the 3 combo’s and the current item is not selected.
|
|
Technical Support
|
Jun 29, 2004 - 3:41 AM
|
Dear Neville,
Thank you for an interesting question. We have not found a way to make the editor’s text selected when the popup listbox is displayed because the edit control exists only when the user is typing the text. In all other cases the CExtBarTextFieldButton class just paints the toolbar button like an edit control. We need some time to takle this problem.
|
|
Neville Franks
|
Jun 30, 2004 - 1:28 AM
|
Ok, Thanks I’ll wait. I assume I can always change the code to create the Combobox myself like the Prof-Studio sample code to work-around this issue?
|
|
Technical Support
|
Jun 30, 2004 - 3:25 AM
|
Dear Neville,
Of course you can use combo-boxes in the toolbars instead of built-in text/combo fields. But you will lose some important features:
- only built-in text/combo fields can be drag-and-dropped in the customize mode
- only built-in text/combo fields can be used in popup menus (for example, popup items in the menu bar and popup menu invoked with the toolbar’s chevron button ( or the Toolbar Options button ))
- the
CExtCustomizeSite class provides automatic synchronization of multiple copies of a text/combo field anywhere
- having chosen the combo box control, you will have to keep all list box string values in the control’s memory
We believe you will decide on Prof-UIS’s built-in text/combo fields even without support for highlighted text when the popup list box is displayed.
|
|
Neville Franks
|
Jun 30, 2004 - 4:50 AM
|
Thanks for all the extra information. I will stay with the built-in text/combo fields, however I think it is important that the selection problem be addressed for two reasons. 1) It is standard Windows behaviour. 2) It is quite annoying to have to manually delete the existing text before you can type something new. I’m using this text/combo to let the user enter text they want to search for and using the combo as a history. Most of the time you want to enter new search text. If it is selected then of course there is no problem as the selection is deleted when the first new character is typed. Thanks, Neville
|
|
Neville Franks
|
Jun 28, 2004 - 4:17 AM
|
Hi, I’ve got CExtControlBar with a TreeCtrl inside it and I’d like to add a button to the CExtControlBar title bar. It would appear to the left of the ’Auto Hide’ button or at the very left before the title text. Is this possible and if so how?
|
|
Technical Support
|
Jun 28, 2004 - 10:27 AM
|
Dear Neville,
We recommend you to use some kind of container window inside the resizable bar. This container window should keep a horizontal toolbar window at top and a tree control at bottom (i.e. the tree occupies the rest of the container space). You may find an appropriate solution in the ProfStudio example.
Of course, you may insert your own buttons into the caption of the resizable bar. Your buttons can be located both at the left and at the right side of the bar’s caption. Please take a look at the CMyTaskAreaBar class in the MDI sample application. It uses two instances of the CMyTaskAreaBar::CBarNcTaskAreaBtn class as the left and right arrow buttons. They are initialized in the CMyTaskAreaBar::OnNcAreaButtonsReinitialize virtual method.
|
|
Neville Franks
|
Jun 28, 2004 - 2:59 PM
|
Great, thanks. I may end up using a container window but to save waisting the space it would need, the possibility of using a button on the caption is appealing. Nevile
|
|
Neville Franks
|
Jun 28, 2004 - 4:10 AM
|
Hi, I’ve got a combo box on a toolbar and I’d like to validate what the user types into the edit area when Enter is pressed. If it is invalid I want focus to remain in the combo edit area. I’m using CMainFrame::OnTextFieldVerify() but this is called for each keypress and doesn’t tell me what key the user pressed (eg. Enter). I’ve looked at CExtBarTextFieldButton::CInPlaceEditWnd::WindowProc() which does verify for VK_RETURN however it exits the combo regardless of what is returned by CMainFrame::OnTextFieldVerify(). Any suggestions?
|
|
Technical Support
|
Jun 28, 2004 - 10:12 AM
|
Dear Neville,
You should override the CExtCustomizeSite::OnTextFieldInplaceTextSet method. The default implementation of this method in the ExtCustomize.cpp file assigns a new string value to the text field: sTextFieldBuffer = sTextNew;
If your method does not do this, the text field will have the previous value. Of course, you can use any verified or corrected string value instead of that which is stored in the sTextNew parameter.
|
|
Neville Franks
|
Jun 28, 2004 - 2:42 PM
|
Hi, I already override CExtCustomizeSite::OnTextFieldInplaceTextSet() with CMainFrame::OnTextFieldInplaceTextSet() however I don’t see how this lets me resolve my issue as it is called when Enter is pressed and the edit session is ending. What I want is to:
- When Enter is pressed validate what the user typed.
- If it is invalid continue with inplace editing. I use a popup tip to tell the user what the problem is.
- If it is valid end editing and return focus to parent window as normal.
Thanks, Neville
|
|
Technical Support
|
Jun 29, 2004 - 3:34 AM
|
Dear Neville,
To catch the VK_RETURN key event you can override the CExtCustomizeSite::OnTextFieldWndProcHook virtual method, which should work both for text/combo fields in toolbars and for popup menus. Beside you may display a tooltip somewhere next to the edit control. Please note, your tooltip must be the topmost window (i.e. having the WS_EX_TOPMOST extended window style) and appear on screen as a non-active window.
|
|
Grant McDade
|
Jun 28, 2004 - 12:15 AM
|
I have discovered that trying to programmatically set the check status of a disabled radio button causes the program to hang. This is because the implementation of the CExtRadioButton does not take into consideration the fact that GetNextDlgGroupItem skips disabled controls. This means that when starting with a disabled control and looping through the group you never reach the starting control again and so the loop never exits. Regards, Grant
|
|
Technical Support
|
Jun 29, 2004 - 3:00 AM
|
Dear Grant,
Thank you for the bug information. Please modify the CExtRadioButton::_UncheckRadioButtonsInGroup method in this way: void CExtRadioButton::_UncheckRadioButtonsInGroup()
{
ASSERT_VALID (this);
CWnd* pWndParent = GetParent();
if (pWndParent == NULL)
return;
ASSERT_VALID( pWndParent );
CWnd *pWnd = pWndParent->GetNextDlgGroupItem( this );
if( !this->IsWindowEnabled() ) return; //INSERT THIS LINE!!!
while( pWnd != this && pWnd != NULL )
{
...
|
|
Alexey Ignatenko
|
Jun 25, 2004 - 6:02 AM
|
There is a fatal misprint (?) bug in implementation of ExtPageContainerWnd::PageRemove (prof-uis version 2.25) (line 1749) if( nLastIndex > nCount ) nLastIndex = nCount - 1; ASSERT( nLastIndex >= nIndex ); nCount is a number of elements to remove. And it is compared with the index of the last element to remove. Therefore, it does not work at all, usually assigning nLastIndex equal to 0. Most probably, this code checks if the index of the last element to remove exceeds the number of elements in the list. If, so it should be like this: if( nLastIndex > nPageCount ) nLastIndex = nPageCount - 1; ASSERT( nLastIndex >= nIndex ); After this correction, page removal works quite well.
|
|
Technical Support
|
Jun 29, 2004 - 6:37 AM
|
Dear Alexey,
Yes, this was a bug (typo). Thank you very much!
|
|
MARK ROBERTS
|
Jun 23, 2004 - 2:31 PM
|
After installing 2.25 I keep getting the popup dialogbox Project Configuration are out of date . Would you like to build them? This dialogbox will always popup everytime you run the application in debug or release. I called tech support and I was told that there was a new build today and to download it. The problem still persist. This problem does not happen if I go back to 2.24
|
|
Technical Support
|
Jun 24, 2004 - 3:04 AM
|
Dear Mark,
You have two options on how to get rid of the "These project configuration(s) are out of date" dialog:
- Click Yes when the dialog is open, which means you will make the IDE build all projects in the solution.
- Open the Configuration manager dialog (Build->Configuration Manager...) and deselect the projects you do not want to be compiled.
If this is not what you mean, then please let us know.
|
|
Luis Palacios
|
Jun 12, 2004 - 6:18 PM
|
Hi, A disabled CExtEdit control is not painted correctly, it was created with the Add variable wizzard. The buttons of a CExtResizablePropertySheet hides and only appear when the property sheet is resized. The problem was not reproduced when the CPropertySheet was templated with CExtWS. The used environment was MSVC 7.1 Thank you Luis
|
|
Technical Support
|
Jun 14, 2004 - 2:52 AM
|
Dear Luis, Thank you for the bug report. We have already fixed it. You should not encounter this problem in the next version.
|
|
Luis Palacios
|
Jun 14, 2004 - 8:22 AM
|
Hi, Can you send me by e-mail the corrected source code?, I have to deliver a pre-release product in a couple of weeks. Thank you very much Luis Palacios
|
|
Technical Support
|
Jun 15, 2004 - 10:11 AM
|
Dear Luis,
We sent you the latest version (2.25) by e-mail. It will be officially released in a couple of days.
|
|
Neville Franks
|
Jun 7, 2004 - 5:00 AM
|
Hi, My users tell me they don’t like having hidden menu items. Is the best and correct way to control this to set: CExtPopupMenuWnd::g_bMenuExpanding = false. I found this by looking at the code for: "Always show full menus". Thanks, Neville www.surfulater.com
|
|
Technical Support
|
Jun 7, 2004 - 7:24 AM
|
Dear Neville,
The feature in question is disabled with these two lines in the initialization code:CExtPopupMenuWnd::g_bMenuExpanding = false;
CExtPopupMenuWnd::g_bMenuHighlightRarely = false;
|
|