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 |
|
Ramesh Sojitra
|
Jan 24, 2009 - 7:08 AM
|
Hi, I have following problems in my application. I am using Prof-UIS 2.84 version 1. I have a dialog application. In this I have scrollbar with class CExtScrollBar. I am not getting SB_LINEUP event in case of vertical scrollbar & SB_LINELEFT event in case of horizontal scrollbar. & scrollbar draw problem. 2. In dialog If I Keep SetPaneText() of statusbar in thread, it asserts & finally crashes the application in debug mode. 3. If I keep status bar in dialog having Style “Dialog Frame”. Then status bar border isn’t drawn properly at right-bottom corner (In gripper place). This case is with theme name “CExtPaintManagerOffice2003”. 4. In my MDI application. Each time I track through menu item it calls OnDraw() of CView class & it refreshes view. Again On switching between views it calls OnDraw() function for all the views (I need only for active view ). 5. If any problem is there in Pro-UIS dialog controls, then please send us the issues because currently we are to upgrade our dialog application from MFC control classes to Prof-UIS control classes. 6.I want to insert slider controls in toolbar vertically so it takes less space. what is the procedure for that?
|
|
Scott Moore
|
Jan 23, 2009 - 8:49 PM
|
I have a grid of cell values that the user can view and possibly edit. When they edit a value, I will submit the new value to a server and validate it. But I’m not sure of the proper way to do it. Initially, I think I should override the OnGbwBeginEdit method and set a flag that the user is editing a value. But there isn’t a OnGbwEndEdit method. My best guess is to use the OnGbwFocusChanging to know when the user has finished editing a value. Is this the best way to know when the user has finished editing a grid value? Thanks for any help.
|
|
Scott Moore
|
Feb 2, 2009 - 3:30 PM
|
Why doesn’t OnGbwBeingEdit get called before editing begins on a cell? I need to detect when a user is about to edit a cell so I can determine if the input should be masked or not (e.g., password field).
|
|
Technical Support
|
Feb 3, 2009 - 12:31 PM
|
You should apply the __EGWS_BSE_EDIT_DOUBLE_LCLICK style to your grid window using its CExtGridWnd::BseModifyStyle() method. This style is present in grid by default because it’s listed in the definition of the __EGWS_BSE_DEFAULT preprocessor variable. Please check whether you removed this style during grid initialization.
|
|
Offer Har
|
Jan 24, 2009 - 8:04 AM
|
Override CExtGridWnd::OnGridCellInputComplete Called when the user finished the in-place edit.
|
|
Scott Moore
|
Jan 28, 2009 - 8:02 AM
|
Thanks, that worked. Something I can’t seem to figure out though is OnGbwBeginEdit() . That never gets called when I double-click a cell and start editing. But if I click in another cell while editing, then it gets called right before the editor disappears. How can I figure out when a cell value is about to be editied?
|
|
Technical Support
|
Jan 28, 2009 - 11:44 AM
|
The following virtual method is invoked for all the grid cells when editing is complete and cell value is changed: virtual void OnGridCellInputComplete(
CExtGridCell & _cell,
LONG nColNo,
LONG nRowNo,
INT nColType,
INT nRowType,
HWND hWndInputControl = NULL
);
The following virtual method is invoked during text typing ( bEndEdit==false ) and finally before editor window closing ( bEndEdit==true ) and allows you to verify edited text: virtual bool OnInplaceControlTextInputVerify(
HWND hWndInplaceControl,
CExtGridWnd & wndGrid,
LONG nVisibleColNo,
LONG nVisibleRowNo,
LONG nColNo,
LONG nRowNo,
INT nColType,
INT nRowType,
__EXT_MFC_SAFE_LPCTSTR sTextInitial,
__EXT_MFC_SAFE_LPCTSTR sTextPrevious,
CExtSafeString & sTextNew,
bool bEndEdit
) const;
If the edited text is not valid, then you can simply return false to roll back the last text changing. You can also modify the sTextNew text.
|
|
Scott Moore
|
Jan 28, 2009 - 2:17 PM
|
What method is invoked at the time editing begins? OnGbwBeginEdit() does not get called when I double click a cell and begin editing the value.
|
|
Eric Houvenaghel
|
Jan 23, 2009 - 2:13 PM
|
Hello, Is it posible to have two check boxes in a grid cell. ------------------- | ------------------- | ------------------- ā” X ā” Y | ā” X ā” Y | ------------------- | ------------------- | ------------------- Using CExtGridWnd.
|
|
Eric Houvenaghel
|
Jan 26, 2009 - 9:45 AM
|
Thank you for offering the code this grid cell. The module that we are trying to build is still in it’s infancy. We’ll get it working with existing controls and maybe we could take you up on your offer at a later day. Thanks again.
|
|
Technical Support
|
Jan 26, 2009 - 5:59 AM
|
This task requires a new grid cell class which paints two check boxes and texts near them, handle mouse clicks on the check boxes and provide notifications. It would not be a problem to draw such grid cell and handle mouse input so we could quickly create this grid cell class for you. But we have no idea how to handle keyboard input in it. In the grid cell with single check box we are using the space key for checking/un-checking it. We need your advice about keyboard behavior for your double-check grid cell.
The grid cell described in your message can be replaced with the CExtGridCellCheckListComboBox grid cell which contains two combo box items. Please run the ProfUIS_Controls sample application, select the Grid dialog page, then click the CheckCombo hyperlink which is second from bottom in the first column of hyperlinks under the grid control. As a result, the selected column in the grid control above the hyperlinks will contain the CExtGridCellCheckListComboBox grid cells.
|
|
miles waldron
|
Jan 23, 2009 - 8:47 AM
|
First of all I would like to thank you very much for helping me with the issue that I am having regarding use PROF-UIF controls inside MFC dialogs. The fixed project file was helpful. Thank you, thank you, thank you! For any PROF-UIF class, how do I find out the proper "class" name that needs to be put inside the custom control in the dialog? Where is documentation about this topic? Since, I can’t find any documentation, I am forced to guess, and this is not a good technical solution. Can you assist me with this problem also? New issues keep comming up, and I require more technical support. I have revised the sample program and have uploaded it to the location http://www.optidoc.com/junk.zip. This is an MFC dialog application, where you click a button from the main dialog, to invoke a secondary dialog, say a preferences dialog. This sub dialog has the embedded control m_ExtTabPageContainerWnd as we had working in the main dialog last go around. However, when this control is used inside a dialog (inside the main dialog) it fails to draw the panes. If the control is used within the main dialog, the panes draw properly. So, my project is stuck again until this issue can be resolved. Since working with a specific example proved valuable last go around, I have provided another example of this problem. You will have to change the byte alignment from ZP1 to default for you to test. It is a requirement that all of my projects be built with ZP1 byte alignment, and I have rebuilt all of PROF-UIF with one byte alignment on my development machine. It would be nice to have an example of how this is done in your documentation, so that I can be sure that I have rebuilt everything properly. So, far the byte alignment has not been an issue. Again, the example of the problem is located at http://www.optidoc.com/junk.zip Thanks, Miles Waldron
Advanced Technology Services, Inc.
|
|
Technical Support
|
Jan 23, 2009 - 12:45 PM
|
Please try searching for the CLASS_NAME text in the .../Prof-UIS/Include folder and you will find definitions of all the window class names. Each window class name string is defined near corresponding C++ class. For instance, the following class name is used by the CExtScrollItemWnd class and all the derived from it classes including grid controls (see also class hierarchy in Prof-UIS help):
#define __EXT_SCROLLITEMWND_CLASS_NAME _T("ProfUIS-ScrollItemWindow")
We fixed your test project. We set both the Clip Children and Clip Siblings properties of both the IDD_ANOTHERDIALOG and IDD_INSIDEPANEDIALOG dialogs to true . We set the Visible property of the IDD_INSIDEPANEDIALOG dialogs to true and we set its Style property to Child (the most critical issue). We also recommend you to replace the following line in the CAnotherDialog::OnInitDialog() method: BOOL b1 = m_wndInsidePaneDialog.Create(CInsidePaneDialog::IDD);
With the following: BOOL b1 = m_wndInsidePaneDialog.Create(CInsidePaneDialog::IDD, &m_ExtTabPageContainerWnd);
Nevertheless the CExtTabPageContainer::PageInsert() will change the parent window of inserted page window to the CExtTabPageContainer window, it’s correct to created window as child of tab page container window. Here is the modified version of your test project: http://www.prof-uis.com/download/forums/tmp/Junk2-fixed.zip
|
|
Sergio Buonanno
|
Jan 23, 2009 - 3:01 AM
|
Is there any event to inform when a CExtControlBar is hiding or showing (autohide set) ?
|
|
Sergio Buonanno
|
Jan 26, 2009 - 6:19 AM
|
It doesn’t work, OnControlBarPositionChange is not called every time the user displays the control bar, so it’s useless for me. I need an event fired every time the user moves the mouse pointer on the collapsed (hidden) bar to show it. Before the bar is displayed I need to be notified in order to do some initialization tasks.
|
|
Sergio Buonanno
|
Jan 26, 2009 - 6:19 AM
|
It doesn’t work, OnControlBarPositionChange is not called every time the user displays the control bar, so it’s useless for me. I need an event fired every time the user moves the mouse pointer on the collapsed (hidden) bar to show it. Before the bar is displayed I need to be notified in order to do some initialization tasks.
|
|
Sergio Buonanno
|
Jan 26, 2009 - 6:19 AM
|
It doesn’t work, OnControlBarPositionChange is not called every time the user displays the control bar, so it’s useless for me. I need an event fired every time the user moves the mouse pointer on the collapsed (hidden) bar to show it. Before the bar is displayed I need to be notified in order to do some initialization tasks.
|
|
Technical Support
|
Jan 23, 2009 - 12:44 PM
|
First of all, the CControlBar::IsVisible() method should be used for detecting visibility of any MFC/Prof-UIS control bar. You should override the CExtControlBar::OnControlBarPositionChange() virtual method to track position changing events of docked or floating control bar. The CExtControlBar::AutoHideModeSet() method is virtual and it’s used by Prof-UIS for switching control bar into auto-hidden state and back to docked state.
|
|
Sergio Buonanno
|
Jan 26, 2009 - 6:12 AM
|
It doesn’t work, OnControlBarPositionChange is not called every time the user displays the control bar, so it’s useless for me. I need an event fired every time the user moves the mouse pointer on the collapsed (hidden) bar to show it. Before the bar is displayed I need to be notified in order to do some initialization tasks.
|
|
Technical Support
|
Jan 26, 2009 - 12:04 PM
|
We are sorry, but we forgot to mention that you should update the source code for the following method first: LRESULT CExtControlBar::WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
{
switch( message )
{
case WM_NCMOUSEMOVE:
{
if( ! OnQueryBarHoverProcessingEnabled() )
return 0;
CExtPopupMenuTipWnd * pATTW = OnAdvancedPopupMenuTipWndGet();
if( pATTW == NULL )
return 0;
CPoint ptScreen;
if( ! ::GetCursorPos(&ptScreen) )
return 0;
CExtBarNcAreaButton * pBtn = NULL;
NcButtons_HitTest( ptScreen, &pBtn );
if( pBtn != NULL )
{
ASSERT_VALID( pBtn );
TOOLINFO _ti;
::memset( &_ti, 0, sizeof(AFX_OLDTOOLINFO) );
_ti.cbSize = sizeof( TOOLINFO );
_ti.hinst = ::AfxGetInstanceHandle();
if( pBtn->OnToolHitTest( ptScreen, &_ti ) > 0 )
{
if( _ti.lpszText != NULL && _ti.lpszText != LPSTR_TEXTCALLBACK && _tcslen( _ti.lpszText ) > 0 )
{
CRect rcArea = *pBtn;
CRect rcDefOffsetWnd;
GetWindowRect( &rcDefOffsetWnd );
rcArea.OffsetRect( rcDefOffsetWnd.TopLeft() );
OnAdvancedPopupMenuTipWndDisplay( *pATTW, rcArea, _ti.lpszText );
}
}
if( _ti.lpszText != NULL && _ti.lpszText != LPSTR_TEXTCALLBACK )
::free( _ti.lpszText );
}
}
break;
case WM_PRINT:
case WM_PRINTCLIENT:
{
CDC * pDC = CDC::FromHandle( (HDC) wParam );
CRect rcRgnWnd, rcRgnClient;
GetWindowRect( &rcRgnWnd );
GetClientRect( &rcRgnClient );
if( IsFloating() )
{
CRect rcFloatClient;
GetParentFrame()->GetClientRect( &rcFloatClient );
if( rcRgnClient.Width() > rcFloatClient.Width() )
rcRgnClient.right = rcRgnClient.left + rcFloatClient.Width();
if( rcRgnClient.Height() > rcFloatClient.Height() )
rcRgnClient.bottom = rcRgnClient.top + rcFloatClient.Height();
}
if( (lParam&PRF_NONCLIENT) != 0 )
{
CRect rcWnd = rcRgnWnd, rcClient = rcRgnClient;
ClientToScreen( &rcClient );
rcClient.OffsetRect( -rcWnd.TopLeft() );
rcWnd.OffsetRect( -rcWnd.TopLeft() );
CRgn rgnWnd;
if( rgnWnd.CreateRectRgnIndirect(&rcWnd) )
pDC->SelectClipRgn( &rgnWnd );
pDC->ExcludeClipRect( &rcClient );
DoPaintNC( pDC );
pDC->SelectClipRgn( NULL );
}
if( (lParam&(PRF_CLIENT|PRF_ERASEBKGND)) != 0 )
{
CPoint ptVpOffset( 0, 0 );
if( (lParam&PRF_NONCLIENT) != 0 )
{
CRect rcWnd = rcRgnWnd, rcClient = rcRgnClient;
ClientToScreen( &rcClient );
ptVpOffset.x = rcWnd.left - rcClient.left;
ptVpOffset.y = rcWnd.top - rcClient.top;
}
if( ptVpOffset.x != 0 || ptVpOffset.y != 0 )
pDC->OffsetViewportOrg( -ptVpOffset.x, -ptVpOffset.y );
CDC dcSurface;
CBitmap bmpSurface;
CWindowDC dcDesktop( NULL );
if( dcSurface.CreateCompatibleDC( NULL )
&& bmpSurface.CreateCompatibleBitmap( &dcDesktop, rcRgnClient.Width(), rcRgnClient.Height() )
)
{
CBitmap * pOldBmp = dcSurface.SelectObject( &bmpSurface );
DoEraseBk( &dcSurface );
DoPaint( &dcSurface );
pDC->BitBlt( 0, 0, rcRgnClient.Width(), rcRgnClient.Height(), &dcSurface, 0, 0, SRCCOPY );
dcSurface.SelectObject( pOldBmp );
}
if( ptVpOffset.x != 0 || ptVpOffset.y != 0 )
pDC->OffsetViewportOrg( ptVpOffset.x, ptVpOffset.y );
}
if( (lParam&PRF_CHILDREN) != 0 )
CExtPaintManager::stat_PrintChildren( m_hWnd, message, pDC->GetSafeHdc(), lParam, false );
}
return (!0);
case WM_TIMER:
if( wParam == __TIMER_ID_DRELAYED_REPAINT_FAKE )
{
RedrawWindow( NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE|RDW_ERASENOW|RDW_ALLCHILDREN|RDW_FRAME );
KillTimer( __TIMER_ID_DRELAYED_REPAINT_FAKE );
return 0L;
}
if( AnimationSite_OnHookTimer( UINT(wParam) ) )
return 0L;
break;
case WM_CLOSE:
m_bInCustomModeUpdateCmdUI = true;
return 0;
case WM_DESTROY:
AnimationSite_ClientRemove();
#if (_MFC_VER >= 0x700) && (_MFC_VER <= 0x710)
if( m_pDockSite != NULL && m_pDockSite->IsKindOf( RUNTIME_CLASS(CMDIChildWnd) ) )
{
CFrameWnd * pFrame = GetParentFrame();
if( pFrame != m_pDockSite )
m_bHelperSuppressDestruction = true;
}
#endif
m_bInCustomModeUpdateCmdUI = true;
break;
case WM_NCDESTROY:
AnimationSite_ClientRemove();
if( m_pDockContext != NULL )
{
m_pDockBar = NULL;
delete m_pDockContext;
m_pDockContext = NULL;
}
m_bInCustomModeUpdateCmdUI = true;
NcButtons_RemoveAll();
break;
case WM_SETFOCUS:
{
LRESULT lResult = CControlBar::WindowProc(message, wParam, lParam);
if( IsMinimizedOnRow() )
MaximizeOnRow();
if( ! IsFixedMode() )
{
CWnd * pWnd = GetWindow(GW_CHILD);
if( pWnd != NULL && stat_QueryFocusChangingEnabled( this, pWnd->m_hWnd ) )
pWnd->SetFocus();
}
return lResult;
}
case WM_ERASEBKGND:
if( ! m_bDoNotEraseClientBackground )
return !0;
CExtPaintManager::stat_ExcludeChildAreas( (HDC)wParam, *this );
return CControlBar::WindowProc(message, wParam, lParam);
case WM_CREATE:
{
if( ( ! m_bPresubclassDialogMode ) && ( ! IsFixedMode() ) )
{
ASSERT( GetSafeHwnd() != NULL );
ASSERT( ::IsWindow(GetSafeHwnd()) );
HWND hWndParent = ::GetParent( GetSafeHwnd() );
CFrameWnd * pFrame = NULL;
do
{
ASSERT( hWndParent != NULL );
ASSERT( ::IsWindow(hWndParent) );
CWnd * pWnd = CWnd::FromHandle( hWndParent );
if( pWnd->IsKindOf(RUNTIME_CLASS(CFrameWnd)) )
{
pFrame = (CFrameWnd *)pWnd;
break;
}
} while( pFrame == NULL );
ASSERT( pFrame != NULL );
ASSERT_VALID( pFrame );
if( pFrame->IsKindOf(RUNTIME_CLASS(CMiniFrameWnd)) )
{
pFrame = pFrame->GetParentFrame();
ASSERT( pFrame != NULL );
ASSERT_VALID( pFrame );
ASSERT( !pFrame->IsKindOf(RUNTIME_CLASS(CMiniFrameWnd)) );
}
VERIFY( _FrameEnableDockingImpl( pFrame ) );
}
}
break;
case WM_SHOWWINDOW:
case WM_SIZE:
m_bDelelayRepaintNcButtons = true;
OnControlBarPositionChange( this, __ECBPC_MUTUAL_DEPENDENCY, true, true );
break;
case WM_WINDOWPOSCHANGED:
{
CExtPopupMenuTipWnd * pATTW = OnAdvancedPopupMenuTipWndGet();
if( pATTW != NULL )
pATTW->Hide();
#if (!defined __EXT_MFC_NO_CUSTOMIZE)
CExtCustomizeSite * pSite = NotifiedCustomizeSiteGet();
if( pSite != NULL )
pSite->OnBarStateChanged( this );
#endif
if( m_pDockBar == NULL && (!m_bPresubclassDialogMode) )
break;
LPWINDOWPOS lpWindowPos = reinterpret_cast < LPWINDOWPOS > (lParam);
ASSERT( lpWindowPos != NULL );
if( ! IsFixedMode() )
_UpdateVisibilityInChain();
CExtControlBar * pBar = this;
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
CExtDynTabControlBar * pTabBar = _GetNearestTabbedContainer();
if( pTabBar != NULL && pTabBar != this )
pBar = pTabBar;
#endif
pBar->m_bDelelayRepaintNcButtons = true;
pBar->PostMessage( WM_NCPAINT );
if( (lpWindowPos->flags & SWP_FRAMECHANGED) == 0 )
_RecalcNcArea();
OnControlBarPositionChange( this, __ECBPC_MUTUAL_DEPENDENCY, true, true );
break;
}
case WM_WINDOWPOSCHANGING:
{
m_bDelelayRepaintNcButtons = true;
if( m_pDockBar == NULL && (!m_bPresubclassDialogMode) )
break;
LPWINDOWPOS lpWindowPos = reinterpret_cast < LPWINDOWPOS > (lParam);
ASSERT( lpWindowPos != NULL );
lpWindowPos->flags |= SWP_FRAMECHANGED;
break;
}
case WM_SETTEXT:
{
m_bDelelayRepaintNcButtons = true;
LRESULT lResult = CControlBar::WindowProc(message, wParam, lParam);
if( (! IsFixedMode() ) && (! IsKindOf( RUNTIME_CLASS(CExtDynControlBar) ) ) )
{
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
if( AutoHideModeGet() )
{
CExtDynAutoHideArea * pTabs = CExtDynAutoHideArea::stat_FindAreaOfBar( this );
if( pTabs != NULL )
{
ASSERT_VALID( pTabs );
pTabs->UpdateTabWnd();
CExtDynAutoHideSlider * pAutoHideSlider = pTabs->GetAutoHideSlider();
if( pAutoHideSlider->GetSafeHwnd() != NULL
&& (pAutoHideSlider->GetStyle()&WS_VISIBLE) != 0
)
pAutoHideSlider->SendMessage( WM_NCPAINT );
}
}
else
#endif
if( IsVisible() )
{
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
CWnd * pWnd = GetParent();
bool bRecalcThisNcArea = true;
if( pWnd != NULL
&& pWnd->IsKindOf( RUNTIME_CLASS(CExtDockDynTabBar) )
)
{
ASSERT_VALID( pWnd );
pWnd = pWnd->GetParent();
ASSERT_VALID( pWnd );
CExtDynTabControlBar * pTabBar = DYNAMIC_DOWNCAST( CExtDynTabControlBar, pWnd );
if( pTabBar != NULL )
{
pTabBar->InvalidateSwitcher();
CFrameWnd * pFrame = pTabBar->GetParentFrame();
ASSERT_VALID( pFrame );
pFrame->DelayRecalcLayout();
pFrame->PostMessage( WM_NULL );
LONG nSelIdx = pTabBar->GetSwitcherSelection();
if( nSelIdx >= 0 )
{
CExtControlBar * pBarTest = pTabBar->GetBarAt( nSelIdx, true );
if( pBarTest == this )
{
CString strText;
GetWindowText( strText );
pTabBar->SetWindowText( strText );
}
}
((CExtControlBar*)pTabBar)->_RecalcNcArea();
bRecalcThisNcArea = false;
}
}
if( bRecalcThisNcArea )
#endif
_RecalcNcArea();
}
}
return lResult;
}
}
return CControlBar::WindowProc( message, wParam, lParam );
}
The control bar in the auto hidden mode is really the hidden control bar which is marked as auto hidden. When the mouse pointer is moved over the tab item corresponding to the auto-hidden bar, the bar’s window is temporarily moved into the CExtDynAutoHideSlider window displayed from tabs area with sliding animation. This event should be handled as position changing ( WM_WINDOWPOSCHANGED ) of bar’s child window.
|
|
John Ritzenthaler
|
Jan 22, 2009 - 10:45 AM
|
I read in the support forum that CExtScrollbar in CListCtrl and CTreeCtrl would be available in v2.83. I’ve got that version, how do I do it?
|
|
Technical Support
|
Jan 22, 2009 - 12:45 PM
|
Please use the CExtNCSB < CTreeCtrl > template based type instead of CTreeCtrl class type, and CExtNCSB < CListCtrl > instead of CListCtrl . The CExtNCSB template decorator class covers scroll bar like window non-client area with two CExtScrollBar windows. In Prof-UIS 2.84 we have the extended versions of tree and list view common controls implemented in the CExtTreeCtrl and CExtListCtrl classes. We also have shell tree and list controls and file and browse for folder dialogs based on them. Please take a look at the updated ProfUIS_Controls sample application.
|
|
Offer Har
|
Jan 21, 2009 - 12:04 PM
|
Dear Support, If you insert into a number cell, for example, 5 and the the - sign (that is 5- ) the cell somehow swaps the 5 & - into -5. I would like to prevent the user from inserting the - sign after a number, only before a number. I tried to set m_nNegativeOrder to 1, I added also virtual UINT OnQueryNegativeOrder() const { return 1; } , but still the - after the number is there. Please help. Thanks, Ron.
|
|
Technical Support
|
Jan 23, 2009 - 4:02 AM
|
You should override the CExtGridCellNumberBase::OnFormatCellText() virtual method. Your method should invoke the parent class method and then remove unneeded characters on the right using the strCopy.TrimRight( _T(" \t-") ); code.
|
|
Lars Mohr
|
Jan 21, 2009 - 10:20 AM
|
Dear Support Team, is there any possibility to exchange the CListBox in the CExtMdiWindowsListDlg with a right theme control listBox?Or do you support a CExtListBox? Thank you!
|
|
Lars Mohr
|
Jan 22, 2009 - 1:37 PM
|
|
|
Technical Support
|
Jan 22, 2009 - 12:43 PM
|
We added the following lines into the beginning of the ExtMdiWindowsListDlg.h file:
#if (!defined __EXT_SCROLLWND_H)
#include <ExtScrollWnd.h>
#endif
The CExtMdiWindowsListDlg contains the following property: CExtWFF< CListBox > m_wndListWindows;
We have replaced it with the following one: CExtNCSB < CExtWFF < CListBox > > m_wndListWindows;
Now the list box inside MDI Windows dialog looks as you requested. We do not have the CExtListBox class. We assume the CExtNCSB < CExtWFF < CListBox > > template based class can be a CExtListBox class. If you need fully re-painted list box window, then you can use the CListBoxCustomPainted or CListBoxMenuLike classes implemented as part of the ProfUIS_Controls sample application.
|
|
Scott Moore
|
Jan 21, 2009 - 8:35 AM
|
I’m trying to create an application that is somewhat similiar to your PageContainer sample app.
The thing I want to do differently, is have a window structure like this:
class CMainFrame : public CExtNCW < CFrameWnd >, public CExtDynamicBarSite
class CTabView : public CExtTabPageContainerWnd
CExtDynamicControlBar
CExtResizableDialog
CInnerToolControlBar (top toolbar on form)
CExtControlBar
CExtPageContainerWnd
CExtGridWnd
CExtWFF < CTreeCtrl >
CExtControlBar
<Other Controls>
CExtResizeableDialog
<Other Controls>
The problem is the application hangs trying to create the first CExtControlBar
CExtControlBar _wndResizableBarLeft;
if (!(_wndResizableBarLeft.Create(
NULL,
this,
ID_SERVERS_RESIZEABLE_BAR_LEFT,
WS_CHILD|WS_VISIBLE|CBRS_TOP|CBRS_FLYBY|CBRS_SIZE_DYNAMIC)
&& _wndPages.Create(&_wndResizableBarLeft, (UINT)IDC_STATIC, CRect(0,0,0,0), __EPCWS_STYLES_DEFAULT)
&& _wndGrid.Create(&_wndPages, CRect(0, 0, 300, 300), (UINT)IDC_SERVER_GRID, WS_CHILD|WS_VISIBLE,__ESLW_SMOOTH_SCROLL)
&& _wndTree.Create(WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL|TVS_HASLINES|TVS_HASBUTTONS|TVS_LINESATROOT|TVS_INFOTIP|TVS_SHOWSELALWAYS, CRect(0,0,300,300), &_wndPages, (UINT)IDC_STATIC)
)
)
{
TRACE0("Failed to create page containers\n");
return -1; // fail to create
}
The problem is it gets stuck in an infinite loop here (EXtControlBar.cpp):
case WM_CREATE:
{
if( (!m_bPresubclassDialogMode) && (!IsFixedMode()) )
{
ASSERT( GetSafeHwnd() != NULL );
ASSERT( ::IsWindow(GetSafeHwnd()) );
HWND hWndParent = ::GetParent( GetSafeHwnd() );
CFrameWnd * pFrame = NULL;
do
{
ASSERT( hWndParent != NULL );
ASSERT( ::IsWindow(hWndParent) );
CWnd * pWnd = CWnd::FromHandle( hWndParent );
if( pWnd->IsKindOf(RUNTIME_CLASS(CFrameWnd)) )
{
pFrame = (CFrameWnd *)pWnd;
break;
}
} while( pFrame == NULL );
Which is because the CExtControlBar is not a direct child of CMainWnd. So, it seems I cannot use a CExtControlBar in a dialog, nor can I use a CSplitterWnd. My question is how can I get similiar child controls as the PageContainer app, but have them inside a CExtDynamicConrolBar? I would also like a splitter type control where I can adjust the controls on the left and right sides.
Thanks for any help.
Scott
|
|
Technical Support
|
Jan 22, 2009 - 12:42 PM
|
Yes, the CExtControlBar control bars should be created inside frame windows only when the CExtToolControlBar toolbars can be created inside dialog. But toolbars inside dialogs cannot be drag-n-dropped.
After more than 10 years of programming with MFC, we do not see strong differences between frame and dialog windows. If you need window based on the dialog template resource and you also need re-dockable control bars, then you should created main frame window with all the required bars and create dialog window inside it as main view window (just create dialog as visible child of main frame, then invoke pDialog->SetDlgCtrlID( AFX_IDW_PANE_FIRST ) ).
|
|
Scott Moore
|
Jan 21, 2009 - 4:44 PM
|
UPDATE - I have successfully manager to do this by embedding a CFrameWnd class on my CExtResizeableDlg that is a child of the dynamic bar. But now my problem is the initial size of the 2 CExtControlBar classes is way too small. The state saves correctly and restores after I adjust their size, quit the app and restart. But I really need to set the initial size to something practical. How do I do that? The CRect() I pass in to the Create has no effect. if (!(_wndResizableBarLeft.Create(
NULL,
_wndFrame,
IDC_SERVERS_RESIZEABLE_BAR_LEFT,
WS_CHILD|WS_VISIBLE|CBRS_TOP|CBRS_FLYBY|CBRS_SIZE_DYNAMIC)
&& _wndPages.Create(&_wndResizableBarLeft, (UINT)IDC_SERVERS_PAGE_CONTAINER_LEFT, CRect(0,0,800,800), __EPCWS_STYLES_DEFAULT|__EPCWS_PAGE_BORDERS)
&& _wndGrid.Create(&_wndPages, CRect(0, 0, 800, 800), (UINT)IDC_SERVER_GRID, WS_CHILD|WS_VISIBLE)
&& _wndTree.Create(WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL|TVS_HASLINES|TVS_HASBUTTONS|TVS_LINESATROOT|TVS_INFOTIP|TVS_SHOWSELALWAYS, CRect(0,0,500,500), &_wndPages, (UINT)IDC_SERVER_TREE)
)
)
{
TRACE0("Failed to create page containers\n");
return -1; // fail to create
}
if (!(_wndResizableBarRight.Create(
NULL,
_wndFrame,
IDC_NODE_RESIZEABLE_BAR_RIGHT,
WS_CHILD|WS_VISIBLE|CBRS_TOP|CBRS_FLYBY|CBRS_SIZE_DYNAMIC)
&& _wndNodeList.Create(&_wndResizableBarRight, CRect(0, 0, 600, 600), (UINT)IDC_NODE_LIST, WS_CHILD|WS_VISIBLE)
)
)
{
TRACE0("Failed to create page containers\n");
return -1; // fail to create
}
|
|
Scott Moore
|
Jan 21, 2009 - 8:55 AM
|
Update: Just playing around with the code, I did this before the Create() _wndResizableBarLeft.m_bPresubclassDialogMode = 1; Which allows the application to start, but the controls do not display correctly.
|
|
Technical Support
|
Jan 22, 2009 - 12:45 PM
|
We would prefer to create a dialog inside a frame. But creating a frame inside a dialog is ok. Please note, the frame window deletes itself in the CFrameWnd::PostNcDestroy() virtual method. So, you should create a frame window as a dynamic object or override the CFrameWnd::PostNcDestroy() without invoking the parent class method.
Please use the CExtControlBar::SetInitDesiredSizeHorizontal() , CExtControlBar::SetInitDesiredSizeVertical() and CExtControlBar::SetInitDesiredSizeFloating() to set initial desired sizes of the control bar.
|
|
tera tera
|
Jan 20, 2009 - 11:07 PM
|
Hello. When, in the following situation, I click pro-TreeItem,
A screen scrolls, and a focus moves.
I think it to be an incomplete part in CExtTreeCtrl. ->
|
|
Technical Support
|
Jan 23, 2009 - 4:11 AM
|
Thank you for reporting this issue. We fixed it. You can drop us an e-mail to the support mail box at this web site and we will provide you with the source code update.
|
|
Chris Anderson
|
Jan 20, 2009 - 3:58 PM
|
I just found a behavior change in CExtComboBox class : if you insert a large number of items ( say 100 ) into a combo box, during run time, click the combo box, and press "Page Down", it always jump to the last item, while in MFC it only goes to the next "page". Looks like this is done on purpose, see
void
CExtComboBoxPopupListBox::OnKeyDown( UINT nChar, UINT nRepCnt, UINT nFlags ) { ...
case VK_END:
case VK_NEXT:
{
// Select last non-disabled item
INT nCurSel = pListBox->GetCurSel();
INT nCount = pListBox->GetCount();
INT nSel = nCount;
any reason behind this ? thanks
|
|
Technical Support
|
Jan 22, 2009 - 12:35 PM
|
Thank you for reporting this issue. To fix it, please update the source code for the CExtComboBoxPopupListBox::OnKeyDown() method:
void CExtComboBoxPopupListBox::OnKeyDown( UINT nChar, UINT nRepCnt, UINT nFlags )
{
ASSERT_VALID( this );
if( m_pCB->GetDroppedState() )
{
DWORD dwComboBoxType = m_pCB->GetStyle() & 0x0003L;
CListBox * pListBox = ( CListBox * ) this;
bool bSelChanged = false;
switch( nChar )
{
case VK_LEFT:
case VK_UP:
{
INT nCount = pListBox->GetCount();
if( nCount == 0 )
break;
// Go up until we find a valid selection then set the current selection to that one
INT nCurSel = pListBox->GetCurSel();
INT nSel = nCurSel;
bool bInitSelection = false;
if( nSel < 0 && nCount > 0 )
{
nSel = nCount - 1;
bInitSelection = true;
}
if( nSel != LB_ERR )
{
while( nSel > 0 )
{
INT nItem = nSel - ( bInitSelection ? 0 : 1 );
if( m_pCB->LbItemIsEnabled( nItem ) )
{
if( nCurSel != nItem )
{
pListBox->SetRedraw( FALSE );
INT nRealSel = pListBox->SetCurSel( nItem );
if( nCurSel != nRealSel )
{
if( dwComboBoxType == CBS_DROPDOWNLIST )
{
INT nTopIndex = pListBox->GetTopIndex();
m_pCB->SetCurSel( nRealSel );
pListBox->SetTopIndex( nTopIndex );
}
else
{
CString sText;
pListBox->GetText( nRealSel, sText );
m_pCB->SetWindowText( sText );
m_pCB->SetEditSel( 0, -1 );
}
bSelChanged = true;
}
pListBox->SetRedraw( TRUE );
pListBox->RedrawWindow( NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE|RDW_ERASENOW|RDW_FRAME );
}
break;
}
nSel--;
}
}
}
break;
case VK_RIGHT:
case VK_DOWN:
{
INT nCount = pListBox->GetCount();
if( nCount == 0 )
break;
// Go down until we find a valid selection then set the current selection to that one
INT nCurSel = pListBox->GetCurSel();
INT nSel = nCurSel;
bool bInitSelection = false;
if( nSel < 0 && nCount > 0 )
{
nSel = 0;
bInitSelection = true;
}
if( nSel != LB_ERR )
{
while( nSel < nCount - 1 )
{
INT nItem = nSel + ( bInitSelection ? 0 : 1 );
if( nItem == nCount )
break;
if( m_pCB->LbItemIsEnabled( nItem ) )
{
if( nCurSel != nItem )
{
pListBox->SetRedraw( FALSE );
INT nRealSel = pListBox->SetCurSel( nItem );
if( nCurSel != nRealSel )
{
if( dwComboBoxType == CBS_DROPDOWNLIST )
{
INT nTopIndex = pListBox->GetTopIndex();
m_pCB->SetCurSel( nRealSel );
pListBox->SetTopIndex( nTopIndex );
}
else
{
CString sText;
pListBox->GetText( nRealSel, sText );
m_pCB->SetWindowText( sText );
m_pCB->SetEditSel( 0, -1 );
}
bSelChanged = true;
}
pListBox->SetRedraw( TRUE );
pListBox->RedrawWindow( NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE|RDW_ERASENOW|RDW_FRAME );
}
break;
}
nSel++;
}
}
}
break;
case VK_PRIOR:
{
INT nCount = pListBox->GetCount();
if( nCount == 0 )
break;
INT nTopIndex = pListBox->GetTopIndex();
INT nCurSel = pListBox->GetCurSel();
if( nCurSel == 0 && nTopIndex == 0 )
break;
SCROLLINFO _scroll_info;
::memset( &_scroll_info, 0, sizeof(SCROLLINFO) );
_scroll_info.cbSize = sizeof(SCROLLINFO);
if( ! pListBox->GetScrollInfo( SB_VERT, &_scroll_info ) )
break;
INT nNewSel = _scroll_info.nPos - _scroll_info.nPage;
if( nNewSel < 0 )
nNewSel = 0;
if( nNewSel != nCurSel || nTopIndex != nNewSel )
{
pListBox->SetRedraw( FALSE );
if( nTopIndex != nNewSel )
pListBox->SetTopIndex( nNewSel );
if( nNewSel != nCurSel )
{
m_pCB->SetCurSel( nNewSel );
bSelChanged = true;
}
if( dwComboBoxType != CBS_DROPDOWNLIST )
{
CString sText;
pListBox->GetText( nNewSel, sText );
m_pCB->SetWindowText( sText );
m_pCB->SetEditSel( 0, -1 );
}
pListBox->SetRedraw( TRUE );
pListBox->RedrawWindow( NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE|RDW_ERASENOW|RDW_FRAME );
}
}
break;
case VK_NEXT:
{
INT nCount = pListBox->GetCount();
if( nCount == 0 )
break;
INT nTopIndex = pListBox->GetTopIndex();
INT nCurSel = pListBox->GetCurSel();
SCROLLINFO _scroll_info;
::memset( &_scroll_info, 0, sizeof(SCROLLINFO) );
_scroll_info.cbSize = sizeof(SCROLLINFO);
if( ! pListBox->GetScrollInfo( SB_VERT, &_scroll_info ) )
break;
INT nNewTopIndex = _scroll_info.nPos + _scroll_info.nPage;
INT nNewSel = nNewTopIndex + _scroll_info.nPage - 1;
if( nNewSel >= nCount )
nNewSel = nCount - 1;
if( nNewSel != nCurSel || nNewTopIndex != nTopIndex )
{
pListBox->SetRedraw( FALSE );
if( nNewSel != nCurSel )
{
m_pCB->SetCurSel( nNewSel );
bSelChanged = true;
}
if( nNewTopIndex != nTopIndex )
m_pCB->SetTopIndex( nNewTopIndex );
if( dwComboBoxType != CBS_DROPDOWNLIST )
{
CString sText;
pListBox->GetText( nNewSel, sText );
m_pCB->SetWindowText( sText );
m_pCB->SetEditSel( 0, -1 );
}
pListBox->SetRedraw( TRUE );
pListBox->RedrawWindow( NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE|RDW_ERASENOW|RDW_FRAME );
}
}
break;
case VK_HOME:
{
INT nCount = pListBox->GetCount();
if( nCount == 0 )
break;
// Select first non-disabled item
INT nCurSel = pListBox->GetCurSel();
INT nSel = 0;
while( nSel < nCount - 1 )
{
INT nItem = nSel;
if( m_pCB->LbItemIsEnabled( nItem ) )
{
if( nCurSel != nItem )
{
pListBox->SetRedraw( FALSE );
INT nRealSel = pListBox->SetCurSel( nItem );
if( nCurSel != nRealSel )
{
if( dwComboBoxType == CBS_DROPDOWNLIST )
{
INT nTopIndex = pListBox->GetTopIndex();
m_pCB->SetCurSel( nRealSel );
pListBox->SetTopIndex( nTopIndex );
}
else
{
CString sText;
pListBox->GetText( nRealSel, sText );
m_pCB->SetWindowText( sText );
m_pCB->SetEditSel( 0, -1 );
}
bSelChanged = true;
}
pListBox->SetRedraw( TRUE );
pListBox->RedrawWindow( NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE|RDW_ERASENOW|RDW_FRAME );
}
break;
}
nSel++;
}
}
break;
case VK_END:
{
INT nCount = pListBox->GetCount();
if( nCount == 0 )
break;
// Select last non-disabled item
INT nCurSel = pListBox->GetCurSel();
INT nSel = nCount;
while( nSel > 0 )
{
INT nItem = nSel - 1;
if( m_pCB->LbItemIsEnabled( nItem ) )
{
if( nCurSel != nItem )
{
pListBox->SetRedraw( FALSE );
INT nRealSel = pListBox->SetCurSel( nItem );
if( nCurSel != nRealSel )
{
if( dwComboBoxType == CBS_DROPDOWNLIST )
{
INT nTopIndex = pListBox->GetTopIndex();
m_pCB->SetCurSel( nRealSel );
pListBox->SetTopIndex( nTopIndex );
}
else
{
CString sText;
pListBox->GetText( nRealSel, sText );
m_pCB->SetWindowText( sText );
m_pCB->SetEditSel( 0, -1 );
}
bSelChanged = true;
}
pListBox->SetRedraw( TRUE );
pListBox->RedrawWindow( NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE|RDW_ERASENOW|RDW_FRAME );
}
break;
}
nSel--;
}
}
break;
default:
CWnd::OnKeyDown( nChar, nRepCnt, nFlags );
return;
} // switch( nChar )
if( bSelChanged )
{
// The CBN_SELCHANGE notification message is not sent when the selection
// is changed using the CB_SETCURSEL message.
if( ! m_pCB->m_bEnableSelChangeWorkaround )
{
CWnd * pWnd = m_pCB->GetParent();
if( pWnd->GetSafeHwnd() != NULL )
{
ASSERT_VALID( pWnd );
pWnd->SendMessage(
WM_COMMAND,
MAKEWPARAM( m_pCB->GetDlgCtrlID(), CBN_SELCHANGE ),
(LPARAM) m_hWnd
);
}
}
}
return;
} // if( m_pCB->GetDroppedState() )
CWnd::OnKeyDown( nChar, nRepCnt, nFlags );
}
|
|
Chris Anderson
|
Jan 22, 2009 - 2:33 PM
|
thanks for your help, will try this out
|
|
Rado Manzela
|
Jan 20, 2009 - 3:35 PM
|
I have strange performance issue after upgrading prof-uis while my code is almost identical (confirmed by downgrading to older vesion again). My app has 2 views divided by horizontal splitter. Upper view is tree grid, bottom is tab control containing dialog which contains some ext combo boxes. When I start my app, everything works correctly. But when I focus any combo box, moving of the app window over the screen is much slower (it drops to maybe 1 FPS) especially when piece of title bar is cut by top of the screen.
CPU usage seems to be very low in contrast of normal situation when moving is more smooth but CPU usage is above 90%. It looks like some lazy redrawing (or only invalidating?) of the app window. Do you have idea what could be wrong? How to find the reason? Thank you.
|
|
Technical Support
|
Jan 27, 2009 - 11:38 AM
|
We successfully reproduced the problem and are working on it. It occurs only on Windows XP, only on slow machines and only in 10% of attempts reproducing it. This debugging and analysis are very hard. We are even not 100% sure if this is a Prof-UIS issue at all.
|
|
Rado Manzela
|
Jan 29, 2009 - 3:49 PM
|
Do you have any news on this? I can imagine it’s hard to debug this. I have this issue in 100% attempts. I have AMD sempron 3400+ notebook. But when I use prof-uis 2.82 it works normal (haven’t tried 2.83), there must be some bug in new version, it looks unlikely to be bug in windows, unless you are using some other API which is buggy.
|
|
Technical Support
|
Jan 22, 2009 - 12:34 PM
|
Which Windows version, which Prof-UIS sample application and which Prof-UIS theme should we use for reproducing this issue?
|
|
Rado Manzela
|
Jan 26, 2009 - 1:10 PM
|
I’ve made test application. Just select office theme, select some item from combo box and try to move app window over screen (esp. keep half of title bar out of screen). http://rrrado.szm.sk/treetest.rar
|
|
Rado Manzela
|
Jan 23, 2009 - 12:17 PM
|
Windows XP, only Office 2007 themes. Other themes works good. Unfortunately currently I don’t have time to search and try the samples, I’ll try next week if you don’t have idea.
|
|
Ulrich Heinicke
|
Jan 20, 2009 - 2:40 PM
|
Hi, i construct my menus dynamically at runtime as you describe it in the feature-article. But i don’t know how to set the text for the statusbar of the menu items. Please tell me how i can do this. Thanks
|
|
Ulrich Heinicke
|
Jan 26, 2009 - 2:55 PM
|
Hi, i add in mainfrm.cpp the following code: ON_REGISTERED_MESSAGE(CExtPopupMenuWnd::g_nMsgPrepareMenu, OnExtMenuPrepare) #define ID_GENERAL_MARKER 32805
#define ID_START_MENU 32820
LRESULT CMainFrame::OnExtMenuPrepare(WPARAM wParam, LPARAM lParam)
{
lParam;
CExtCmdItem* pCmdItem;
CExtPopupMenuWnd::MsgPrepareMenuData_t * pData =
reinterpret_cast < CExtPopupMenuWnd::MsgPrepareMenuData_t * > ( wParam );
ASSERT( pData != NULL );
CExtPopupMenuWnd * pPopup = pData->m_pPopup;
ASSERT( pPopup != NULL );
INT nReplacePos;
nReplacePos = pPopup->ItemFindPosForCmdID( ID_GENERAL_MARKER );
if (nReplacePos >= 0)
{
VERIFY( pPopup->ItemRemove(nReplacePos) );
pCmdItem = g_CmdManager->CmdAllocPtr(g_CmdManager->ProfileNameFromWnd(this->GetSafeHwnd()), ID_START_MENU);
if(pCmdItem != NULL)
{
CString sMoreWindows(_T("Windows..."));
CString sManageWindows(_T("Manages the currently open windows"));
pCmdItem->m_sMenuText = sMoreWindows;
pCmdItem->m_sToolbarText = pCmdItem->m_sMenuText;
pCmdItem->m_sTipTool = sManageWindows;
pCmdItem->m_sTipStatus = pCmdItem->m_sTipTool;
pCmdItem->StateSetBasic( true );
pPopup->ItemInsert(ID_START_MENU, nReplacePos, __EXT_MFC_SAFE_LPCTSTR(sMoreWindows), NULL, m_hWnd);
}
return 1L;
}
return 0;
} When i open the menu a first time i see the menu text the second time the menu text is missing Please tell me what’s wrong. Thanks
|
|
Technical Support
|
Jan 27, 2009 - 11:38 AM
|
Please replace the following code: pCmdItem = g_CmdManager->CmdAllocPtr(g_CmdManager->ProfileNameFromWnd(this->GetSafeHwnd()), ID_START_MENU);
with: pCmdItem = g_CmdManager->CmdAllocPtr(g_CmdManager->ProfileNameFromWnd(this->GetSafeHwnd()), ID_START_MENU);
if( pCmdItem == NULL )
pCmdItem = g_CmdManager->CmdGetPtr(g_CmdManager->ProfileNameFromWnd(this->GetSafeHwnd()), ID_START_MENU);
The CExtCmdManager::CmdAllocPtr() method returns NULL if the specified command identifier was already allocated.
|
|
Ulrich Heinicke
|
Jan 28, 2009 - 3:11 PM
|
Hi, i a little wondering why every time i click on the menu the variable nReplacePos is greater or equal 0. The first time i call ItemFindPosForCmdID they can find the ID and the position is ok, but the next time ItemFindPosForCmdID they can’t find it, because i call ItemRemove . So nReplacePos must be invalid, maybe -1, but every time it is 0. I think that’s a bug. Why should i call ItemInsert every time i click on the menu ?
|
|
Technical Support
|
Jan 29, 2009 - 12:44 PM
|
The CExtPopupMenuWnd popup menu in most cases is constructed from a CMenu /HMENU Win32 menu tree. Prof-UIS menus are tree like data structures which use the CExtPopupMenuWnd objects as tree nodes. The CExtPopupMenuWnd trees are data structures which are not based on Win32 menus. The Win32 menus are just used for initialization of Prof-UIS menus and this is very convinient. Your code will find marker command each time you opening menu. It’s often required to replace such marker commands with different set of commands depending from the current application state.
|
|
Ulrich Heinicke
|
Jan 29, 2009 - 1:32 PM
|
So, let me describe what i need: when i start my program it will look for available modules. Then for each of the modules it should add an entry into several menus in the menubar. After that the menus will be fixed. Is there a way to do that with CExtPopuoMenuWnd like i did it before with CMenu ? Thanks
|
|
Technical Support
|
Jan 30, 2009 - 3:19 AM
|
The difference between CExtPopupMenuWnd and CMenu is that the CExtPopupMenuWnd objects always delete themselves automatically when menu is closed. So, you cannot use CExtPopupMenuWnd as CMenu . But your question already contains answer. You can simply modify CMenu which is used by CExtPopupMenuWnd .
|
|
Ulrich Heinicke
|
Jan 23, 2009 - 12:20 PM
|
My program load some plugins and for that i need menu items. But i don’t know how many menu items need. So it is difficulte to setup a range at program start. It is possible to add a range after initialization? Maybe with a small example? Thanks
|
|
Technical Support
|
Jan 26, 2009 - 6:00 AM
|
The entire range of available commands is in the range of 1...65634 . The Visual Studio wizards allocating command identifiers at the beginning of this range. MFC uses pre-defined command identifiers at the end of this range. Prof-UIS defines its internal identifiers in range 29000..310000 . We guess all of your plugins need less than 2000 identifiers. You can safely use range like 40000...42000 . You can invoke the CExtCmdManager::CmdAllocPtr() method 2000 times at startup for allocating identifiers in the 40000...42000 range. It will not take a long time even if you really need 5000 identifiers or 15000 identifiers
|
|
Technical Support
|
Jan 22, 2009 - 12:36 PM
|
Please use menu items based on the command manager. Your dynamically constructed menu should insert menu commands using the CExtPopupMenuWnd::ItemInsert() method. The command identifiers should be allocated in the command manager using the CExtCmdManager::CmdAllocPtr() method (g_CmdManager->CmdAllocPtr() ). You can allocate some range of commands during application initialization and then simply use commands from this range when constructing dynamic popup menus. If you have pre-allocated command identifier, then you can get pointer to the CExtCmdItem object describing properties of this command using the CExtCmdManager::CmdGetPtr()</code> method. The status tip text is stored in properties of the CExtCmdItem object.
|
|
Offer Har
|
Jan 19, 2009 - 8:32 AM
|
Dear Support, When we exit Prof-UIS (regardless of the version) we get a lot of memory leaks, that runs for a long time, and the only way to gain back control over the environmnet is to kill the DEVENV task and re-run it. Please let us know whaat is the problem, and if we need to give some special handling to Prof-UIS when the application terminates. This is the beginning of the memory dump:
* * * TERMINATING DYNAMIC LIBRARY: ProfUIS version 2.84 * * *
Detected memory leaks!
Dumping objects ->
..\Src\ExtCmdIcon.cpp(6836) : {45488} normal block at 0x03A60E58, 28672 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
..\Src\ExtCmdIcon.cpp(6836) : {45487} normal block at 0x03A67E98, 28672 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\afxtempl.h(406) : {44120} normal block at 0x039C9AC0, 16 bytes long.
Data: < > 00 00 00 00 13 00 00 00 00 00 00 00 13 00 00 00
f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\array_p.cpp(110) : {41423} normal block at 0x039C9E58, 124 bytes long.
Data: < H > DC E0 9F 03 48 E1 9F 03 B4 E1 9F 03 20 E2 9F 03
{39367} normal block at 0x03A0CE38, 24 bytes long.
Data: <` ` > 60 DD 9D 03 C8 B8 A1 03 60 DD 9D 03 0B 00 00 00
f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(141) : {39366} normal block at 0x03A1C110, 25 bytes long.
Data: <, ?x > 2C 08 3F 78 08 00 00 00 08 00 00 00 01 00 00 00
{39360} normal block at 0x03A1B8C8, 24 bytes long.
Data: <p 0 8 > 70 A0 A1 03 30 C8 9F 03 38 CE A0 03 0A 00 00 00
f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(141) : {39359} normal block at 0x03A1B920, 25 bytes long.
Data: <, ?x > 2C 08 3F 78 08 00 00 00 08 00 00 00 01 00 00 00
f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\array_p.cpp(110) : {39357} normal block at 0x03A1BC38, 36 bytes long.
Data: < @ ( 45 > DC F0 A0 03 40 17 A1 03 20 28 A1 03 34 35 A1 03
f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\array_p.cpp(110) : {39356} normal block at 0x03A1BBD8, 36 bytes long.
Data: < @ ( 45 > DC F0 A0 03 40 17 A1 03 20 28 A1 03 34 35 A1 03
{39351} normal block at 0x03A1B7A8, 24 bytes long.
Data: <` ` F > 60 DD 9D 03 E8 B6 A1 03 60 DD 9D 03 46 CB 0D 00
f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(141) : {39350} normal block at 0x03A1B868, 34 bytes long.
Data: <, ?x > 2C 08 3F 78 11 00 00 00 11 00 00 00 01 00 00 00
f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\array_p.cpp(110) : {39348} normal block at 0x03A1B808, 36 bytes long.
Data: < A pA A HB > 04 41 A1 03 70 41 A1 03 DC 41 A1 03 48 42 A1 03
{39343} normal block at 0x03A1B6E8, 24 bytes long.
Data: <` ( E > 60 DD 9D 03 28 B6 A1 03 A8 B7 A1 03 45 CB 0D 00
f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(141) : {39342} normal block at 0x03A1B748, 35 bytes long.
Data: <, ?x > 2C 08 3F 78 12 00 00 00 12 00 00 00 01 00 00 00
{39336} normal block at 0x03A1B628, 24 bytes long.
Data: < D > 88 C5 A1 03 C8 C4 A1 03 E8 B6 A1 03 44 CB 0D 00 If continues to dump something that looks like all of MFC... Thanks, Ron.
|
|
Technical Support
|
Jan 20, 2009 - 5:29 AM
|
The 45488 number in the following text is the invocation number of the malloc() function:
..\Src\ExtCmdIcon.cpp(6836) : {45488} normal block at 0x03A60E58, 28672 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
So, if you invoke the _CrtSetBreakAlloc(45488); code during your application initialization (you can invoke it in the constructor of the CWinApp -derived class) and start debugging it, then the debugger will break execution when the malloc() function is invoked 45488 times. You will be able to take a look at the call stack and find what and where is allocated. We recommend you to find the smallest allocation number in the Output window. This allocation is the earliest memory leak in your application and other/later leaks are often dependent from this leak. If the earliest leak is pointer to the main frame or dialog window, then the most of allocated objects are not destroyed in your application due to some critical or unhandled situation. The easiest way to created big count of leaks is to invoke the ExitThread() or ExitProcess() APIs. You can change the exception handling options while debugging your application and make debugger breaking its execution for all the exceptions independently from whether they are handled or not. For instance, if exception is occurred during the application de-initialization, then it’s typically handled but most of dynamically allocated objects does not become destroyed. Please note, the exception occurred in the other exception handing code is assumed as unexpected exception in C++ and causes process termination. The final and absolutely universal way of finding problems is commenting parts of code and finding configuration which does not generate the problem.
|
|
tera tera
|
Jan 19, 2009 - 2:38 AM
|
Hello. I want to perform a decision when a key moved.
Please teach appropriate programming.
|
|
Technical Support
|
Jan 19, 2009 - 1:14 PM
|
You should handle a WM_KEYDOWN message in your CExtTreeCtrl -derived class. Please take a look at the source code of the CExtTreeCtrl::OnKeyDown() method where the VK_LEFT , VK_RIGHT , VK_UP and VK_DOWN keys are handled.
|
|
tera tera
|
Jan 18, 2009 - 5:44 PM
|
Hello. Like Excel, I want to perform reduction printing in line with paper size.
|
|
Technical Support
|
Jan 19, 2009 - 1:14 PM
|
Could you please send us a print preview screen shot of some Excel table demonstrating printed grid cell layout you need?
|
|
tera tera
|
Jan 18, 2009 - 5:35 PM
|
Hello. Please teach revision contents from 2.84 of CExtPPVW.
CExtPPVW can print normally.
A character does not stick out from the print area.
|
|
Technical Support
|
Jan 19, 2009 - 1:16 PM
|
The CExtPPVW template class versions in Prof-UIS 2.84 and 2.85 use similar print/preview generation algorithms. They walk through all the grid cells, measure them and organize content into pages before generating enhanced metafile of each page. The difference is that 2.85 uses different measurement formulas which are correct when the same computations in 2.84 are not correct and can make some grid cells printed partially outside pages. The CExtPPVW template class in Prof-UIS 2.85 does correct measuring and painting of each printed page and supports several additional features. The CExtPPVW < CExtGridWnd > , CExtPPVW < CExtTreeGridWnd > , CExtPPVW < CExtReportGridWnd > and CExtPPVW < CExtPropertyGridCtrl > specialized versions of the CExtPPVW template class support the following new properties in Prof-UIS 2.85:
- m_bDrawSimpleWhiteBackground - erase background of each printed/previewed grid cell if set to true ; - m_bDrawSimpleBlackBorders - draw thin black borders around each printed/previewed grid cell if set to true ;
In simple words, Prof-UIS 2.85 supports grid lines in printed/previewed grids.
The CExtPPVW < CExtTreeGridWnd > , CExtPPVW < CExtReportGridWnd > and CExtPPVW < CExtPropertyGridCtrl > specialized versions of the CExtPPVW template class support the following new properties in Prof-UIS 2.85:
- m_bDrawSimpleBlackOutline - draw tree thin solid tree outline if set to true ; - m_bDrawSimpleBlackOutlineUsingDots - draw thing dotted tree outline if set to true ; this affects to printing/previewing only if the m_bDrawSimpleBlackOutline property is set to true ;
By default all these new properties is set to false and Prof-UIS 2.85 generates printed/previewed grid content looking similar to that in the previous Prof-UIS versions. But you can turn these features on in your grid controls. For instance, if you invoke the following code in the CChildView class constructor in the ReportGrid sample application:
m_bDrawSimpleBlackBorders
= m_bDrawSimpleBlackOutline
= m_bDrawSimpleBlackOutlineUsingDots
= true;
Then the report grid control will produce the following print/preview content: http://www.prof-uis.com/download/forums/ReportGridPPVW-285.pngAdditionally, Prof-UIS 2.84 does not support printing/previewing of joined cells and the grid window in the SynchronizedGrids sample application does not support printing/previewing. This feature is added in Prof-UIS 2.85 and you can see it in the SynchronizedGrids sample application.
|
|
Kevin Murray
|
Jan 16, 2009 - 4:46 PM
|
Set a MDI Child Wnd to have a non-dockable toolbar. EnableDocking is not called on the frame wnd. Using CExtToolControlBar, I load the toolbar then set the following: pBar->m_bCustomizationAllowed = false;
pBar->m_bRightButtonDisplayBarsList = true;
pBar->m_bAppearInDockSiteControlBarPopupMenu = false;
pBar->m_bReflectParentSizing = true;
pBar->EnableDocking( 0 );
ShowControlBar( pBar, TRUE, TRUE );
This works, except that if you right click on the toolbar you get a popup that has one choice, "Customize...", that doesn’t do anything. Anyway to prevent the popup?
K.
|
|
Technical Support
|
Jan 20, 2009 - 5:21 AM
|
Thank you for reporting this issue. We have successfully reproduced it in the DRAWCLI sample application where we added the following property into the CSplitFrame class:
CExtToolControlBar m_wndNRTB; // non-redockable toolbar
We have created this toolbar in the following method and it really displayed unwanted ID_EXT_CUSTOMIZE menu command in the context menu over it: int CSplitFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if( CExtNCW < CMDIChildWnd > :: OnCreate( lpCreateStruct ) == -1 )
return -1;
ASSERT( m_hChildFrameIcon != NULL );
SetIcon( m_hChildFrameIcon, FALSE );
SetIcon( m_hChildFrameIcon, TRUE );
VERIFY( m_wndNRTB.Create( NULL, this ) );
VERIFY( m_wndNRTB.LoadToolBar( IDR_MAINFRAME ) );
m_wndNRTB.m_bCustomizationAllowed = false;
return 0;
}
To fix this issue please update the source code for the following method: bool CExtDockBar::_ConstructDockSiteControlBarPopupMenu(
CFrameWnd * pFrame,
CExtPopupMenuWnd * pPopup,
SHORT nHelperNotificationType,
CControlBar * pBarEventSrc,
UINT nMsgID, // = WM_NULL
CObject * pObjectSrc // = NULL
)
{
ASSERT_VALID( pFrame );
ASSERT( pPopup != NULL );
CExtControlBar::POPUP_MENU_EVENT_DATA _pmed(
nHelperNotificationType,
pPopup,
pBarEventSrc,
CPoint( -1, -1 ),
nMsgID,
pObjectSrc
);
bool bPreNotificationPassed = _pmed.NotifyTarget( false );
if( !bPreNotificationPassed )
{
ExtControlBarVector_t vBars;
CExtControlBar::_GetFrameControlBars(
NULL,
pFrame,
vBars
);
bool bOleInplaceItemActivated =
CExtControlBar::IsOleIpObjActive( pFrame );
int nBarsCount = (int)vBars.GetSize();
CExtControlBar * pPrevBar = NULL;
for( int i=0; i<nBarsCount; i++ )
{
CExtControlBar * pBar = vBars[i];
ASSERT_VALID( pBar );
if( pBar->GetSafeHwnd() == NULL
|| ( ! ::IsWindow(pBar->GetSafeHwnd()) )
)
continue;
// do not include dynamic bars
if( pBar->IsKindOf( RUNTIME_CLASS(CExtDynControlBar) ) )
continue;
// do not include temporary hidden bars
if( pBar->m_nStateFlags &
//(CControlBar::delayHide | CControlBar::tempHide)
CControlBar::tempHide
)
continue;
// do not include some bars when OLE inplace object active
if( bOleInplaceItemActivated &&
(pBar->m_dwStyle & CBRS_HIDE_INPLACE)
)
continue;
// do not include bars without caption
CString sBarText;
pBar->GetWindowText( sBarText );
if( sBarText.IsEmpty() )
{
// do not include bars without window text to menu
// ASSERT( FALSE );
continue;
}
if( pPrevBar != NULL
&&
pPrevBar->IsFixedDockStyle() != pBar->IsFixedDockStyle()
)
{
VERIFY(
pPopup->ItemInsert(
CExtPopupMenuWnd::TYPE_SEPARATOR
)
);
}
int nBarID = pBar->GetDlgCtrlID();
ASSERT( CExtCmdManager::IsCommand(nBarID) );
CExtCmdItem _cmd;
_cmd.m_nCmdID = nBarID;
_cmd.m_sMenuText = sBarText;
_cmd.TipsLoad();
g_CmdManager->CmdSetup(
g_CmdManager->ProfileNameFromWnd( pFrame->GetSafeHwnd() ),
_cmd
);
if( pBar->OnConstructDockSiteControlBarPopupMenu(pPopup) )
pPrevBar = pBar;
} // for( int i=0; i<nBarsCount; i++ )
} // if( !bPreNotificationPassed )
// remove double separators
INT nCount = pPopup->ItemGetCount();
for( INT nItem = 1; nItem < nCount; )
{
CExtPopupMenuWnd::MENUITEMDATA & _miiPrev =
pPopup->ItemGetInfo( nItem - 1 );
if( !_miiPrev.IsSeparator() )
{
nItem++;
continue;
}
CExtPopupMenuWnd::MENUITEMDATA & _miiCurr =
pPopup->ItemGetInfo( nItem );
if( !_miiCurr.IsSeparator() )
{
nItem++;
continue;
}
pPopup->ItemRemove( nItem );
nCount--;
} // for( INT nItem = 1; nItem < nCount; )
#if (!defined __EXT_MFC_NO_CUSTOMIZE)
bool bAddCustomizeCmd = false;
if( (!bPreNotificationPassed)
&& ( nHelperNotificationType == CExtControlBar::POPUP_MENU_EVENT_DATA::__PMED_CONTROLBAR_CTX
|| nHelperNotificationType == CExtControlBar::POPUP_MENU_EVENT_DATA::__PMED_CONTROLBAR_NC_CTX
|| nHelperNotificationType == CExtControlBar::POPUP_MENU_EVENT_DATA::__PMED_DOCKBAR_CTX
|| nHelperNotificationType == CExtControlBar::POPUP_MENU_EVENT_DATA::__PMED_STATUSBAR_CTX
|| nHelperNotificationType == CExtControlBar::POPUP_MENU_EVENT_DATA::__PMED_MINIFRAME_NC_CTX
)
&& CExtCustomizeSite::GetCustomizeSite( pBarEventSrc->GetSafeHwnd() ) != NULL
)
bAddCustomizeCmd = true;
if( bAddCustomizeCmd
&& pBarEventSrc->GetSafeHwnd() != NULL
&& pBarEventSrc->IsKindOf( RUNTIME_CLASS( CExtToolControlBar ) )
&& ( ! ((CExtToolControlBar*)pBarEventSrc)->m_bCustomizationAllowed )
)
bAddCustomizeCmd = false;
if( bAddCustomizeCmd )
{ // add customize command
LPCTSTR strCmdProfile = g_CmdManager->ProfileNameFromWnd( pFrame->m_hWnd );
if( strCmdProfile != NULL
&& g_CmdManager->CmdGetPtr( strCmdProfile, ID_EXT_CUSTOMIZE ) != NULL
)
{
// add tail separator
nCount = pPopup->ItemGetCount();
if( nCount > 0 )
{
CExtPopupMenuWnd::MENUITEMDATA & _mii =
pPopup->ItemGetInfo( nCount - 1 );
if( !_mii.IsSeparator() )
pPopup->ItemInsert();
} // if( nCount > 0 )
VERIFY( pPopup->ItemInsert( ID_EXT_CUSTOMIZE ) );
CExtPopupMenuWnd::MENUITEMDATA & mi =
pPopup->ItemGetInfo(
pPopup->ItemGetCount() - 1
);
mi.SetForceEnabled();
} // if( strCmdProfile != NULL ...
} // add customize command
#endif // (!defined __EXT_MFC_NO_CUSTOMIZE)
_pmed.NotifyTarget( true );
// remove tail separator
nCount = pPopup->ItemGetCount();
if( nCount > 0 )
{
CExtPopupMenuWnd::MENUITEMDATA & _mii =
pPopup->ItemGetInfo( nCount - 1 );
if( _mii.IsSeparator() )
pPopup->ItemRemove( nCount - 1 );
} // if( nCount > 0 )
return true;
}
|
|
Kevin Murray
|
Jan 20, 2009 - 11:22 AM
|
Thanks! That did the trick! K.
|
|
tera tera
|
Jan 16, 2009 - 1:20 AM
|
Hello. Please teach a method to close AutoHide-Bar.
|
|
Technical Support
|
Jan 19, 2009 - 1:14 PM
|
In the case of simple control bars: CExtControlBar * pBar = . . .
if( pBar->AutoHideModeGet() )
pBar->AutoHideModeSet( false, false, true, true );
else if( pBar->IsVisible() )
pMainFrame->ShowControlBar( pBar, FALSE, FALSE );
In case of dynamic resizable control bars: CExtDynamicControlBar * pBar = . . .
bool bBarIsVisible = false;
CExtDynamicControlBar::eDynamicBarState_t eDBS = pBar->BarStateGet( &bBarIsVisible );
if( bBarIsVisible )
eDBS = pBar->BarStateSet( eDBS, false );
|
|
tera tera
|
Jan 15, 2009 - 10:41 PM
|
|
|
Technical Support
|
Jan 20, 2009 - 5:25 AM
|
We guess the first question is already resolved, isn’t it? As for the second question, the ribbon button on your screen shot is an icon-less button with the centered text and it’s layout is correct.
|
|
tera tera
|
Jan 20, 2009 - 5:12 PM
|
Hello. >As for the second question, the ribbon button on your screen
>shot is an icon-less button with the centered text and it’s layout is correct. With a virtual function, I want to customize it. Thanks,
|
|