Subject |
Author |
Date |
|
Dave Calkins
|
Jan 22, 2008 - 2:52 PM
|
I sent this to the support Email address, but thought it would be good to also post it here. ----------- We just upgraded from v2.60 to v2.82 of the Prof-UIS MFC library and are seeing some issues with one of our apps.
1) Dialog Menu Bar not Rendering
We have a dialog app which has a menu bar. After the upgrade the menu bar no longer shows (the space for it is there, but its not rendering).
Our code is as follows.
- We declare "CCustomPaintManagerHolder<CExtMenuControlBar> wndMenuBar;" in our dialog class (CCustomPaintManagerHolder is a class provided to us by ProfUIS tech support to allow using different look-and-feel themes for different GUI elements; you set a theme for it and it then overrides PmBridge_GetPM() and provides the paint manager you set for that particular item) - DoDataExchange includes => DDX_Control(pDX,IDC_MY_MENUBAR,wndMenuBar); - The menu is loaded with the following
if (!wndMenuBar.LoadMenuBar(IDR_MAINMENU)) { ASSERT(FALSE); return FALSE; } wndMenuBar.m_bCustomizationAllowed = false; wndMenuBar.SetCustomPM(&pmOffice2003);
2) Radio Buttons not Rendering
The same dialog app also has some radio buttons. We’re using CExtRadioButton. They no longer render, all you see is the background.
|
|
Dave Calkins
|
Jan 28, 2008 - 10:51 AM
|
Just wanted to reply to say that this issue has been resolved. Here’s the info in case someone else runs into the same or a similar problem. I sent a sample project with just the GUI code to tech support and they replied with the below.
=== Your project is absolutely OK and we even have no any comments about how to improve it because everything is correct. The CWnd::RepositionBars( 0, 0xFFFF, 0 ); code in the DMetrisLaserRadar::OnInitDialog() method and it does very important work. It repositions all control bars (menu bar, toolbar) in the dialog and make them placed near borders. As result, control bar windows become resized and menu bar and toolbars re-compute positions of their buttons. The main window is not resizable in your application. So, potentially it’s enough to reposition bars only once at startup. Generally the CWnd::RepositionBars( 0, 0xFFFF, 0 ); code should also be invoked from the dialog’s OnSize() handler method. You can also make toolbar and menu bar to force re-position their buttons by invoking the pBar->SetWindowPos( NULL, 0, 0, 0, 0, SWP_NOMOVE |SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_FRAMECHANGED ); code. It looks like in your real project the menu bar was repositioned before it’s was initialized with buttons or not repositioned at all. The empty menu bar on your screen shot can have such incorrect layout of its buttons if your code repositioned bars first and only then loads menu into menu bar. Please check this issue in your real project. Please also check that the bars were repositioned and this is the absolutely last UI initialization step. ===
In response to the above, I moved the RepositionBars() call to the bottom of the OnInitDialog() method and the problem went away. So it would appear that there was some additional initialization which was ocurring after the RepositionBars() call which, while not causing a problem with v2.60 caused an issue with v2.82. The problem is solved with the move of the call to RepositionBars.
|
|
Technical Support
|
Jan 26, 2008 - 12:12 PM
|
We have read all your e-mails, analyzed your test project and replied you by email.
|
|
Dave Calkins
|
Jan 24, 2008 - 2:09 PM
|
I sent a stripped down project to the support Email address. Note that, after stripping it down, the problem went away. Maybe I’m hitting a resource limitation?
|
|
Technical Support
|
Jan 24, 2008 - 12:05 PM
|
We would prefer to avoid any guesses that may be incorrect. Could you send us a stripped version of your project which contains UI code only and demonstrates the problem?
|
|
Technical Support
|
Jan 23, 2008 - 1:18 AM
|
Actually the problem with radio buttons sounds like magic. There have been no considerable changes with this regard since v. 2.60. And the custom paint manager should not affect the problems you encountered. Could you send us the following parts of your project?
1) Project file. 2) Source code files with UI related code.
We believe we will be able to find what is wrong.
|
|
Dave Calkins
|
Jan 23, 2008 - 12:56 PM
|
The problem with the radio buttons has been resolved. I received an Email from your department which suggested the tab order could be causing the problem. I moved the group box to the bottom of the list in the .rc file (giving it the highest tab-order number) and the problem was gone. The group box was set to non-transparent in the resource editor and was listed before the radio buttons which were inside it resulting in it being rendered after the radio buttons (since the rendering apparently goes from high-tab-order to low) and obscuring them.
The dialog menu is still not rendering though (I checked and its first in the tab-order list). I can’t send you my project. I created a new project and the menu works fine in that. So something is messed up with my project. I also tried renumbering all the resources and rebuilding and still no luck.
One note is that we do make a series of profile calls in our OnInitDialog() (see below). Is it possible that the upgrade from v2.60 to v2.82 is suffering from issues due to profile incompatibility? I deleted everything from the registry under my app key but that didn’t help. Is profile info stored anywhere else?
Here are the profile calls we’re making in OnInitDialog(). Note that the dialog toolbar works fine, its the menu thats no showing up.
---- VERIFY( g_CmdManager->ProfileSetup( theApp.m_pszProfileName // __PROF_UIS_PROJECT_CMD_PROFILE_NAME ) );
VERIFY( g_CmdManager->ProfileSetup( theApp.m_pszProfileName, GetSafeHwnd() ) );
VERIFY( g_CmdManager->UpdateFromMenu( theApp.m_pszProfileName, //__PROF_UIS_PROJECT_CMD_PROFILE_NAME, IDR_MAINMENU ) );
VERIFY( g_CmdManager->UpdateFromMenu( theApp.m_pszProfileName, //__PROF_UIS_PROJECT_CMD_PROFILE_NAME, IDR_MYPOPUP_SHOWALL ) );
VERIFY( g_CmdManager->UpdateFromToolBar( theApp.m_pszProfileName, IDR_MAINTOOLBAR ) );
VERIFY( g_CmdManager->UpdateFromToolBar( theApp.m_pszProfileName, IDR_MYTYPES ) ); ----
|
|
Dave Calkins
|
Jan 24, 2008 - 7:53 AM
|
Here’s another data point on the menu issue. If I run Spy++ and use the find window tool I notice something odd. In older versions of the app running with Prof-UIS v2.60, when I mouse over the app with the Spy++ find window tool all the controls highlight as you move over them.
In the app with the new version, Prof-UIS v2.82, when mousing over the window none of the controls highlight. The only thing which highlights is the dialog window itself, so you’re not able to "find" any of the controls.
I haven’t seen this before but am wondering if this is a clue. Any ideas?
|
|
Dave Calkins
|
Jan 24, 2008 - 10:23 AM
|
I noticed something else. If I hit the Alt key on the keyboard and then use the arrows, the drop down menus appear!! But they appear to be originating from under the title bar and each top menu is at the same location. Any ideas?
|
|
Philip Robinson
|
Jan 21, 2008 - 9:02 PM
|
I have two questions here, both regarding CExtDateTimeWnd:
1. How do I suppress the seconds field in the edit control? My requirements ask for format like hh:mm
2. After hiding the "Today" and "None" buttons in the dropdown calendar, how do I get rid of the space they vacated?
Thanks.
|
|
Technical Support
|
Jan 25, 2008 - 2:39 AM
|
1. You can use the CExtDurationWnd::SetShowItem() method which shows/hides the specified field in the date time control. pDateTime->SetShowItem( CExtDurationWnd::second, false ); 2. It seems you found a bug. Thank you. To fix it, please update the following method: bool CExtDateTimeWnd::OnShowDropDownMenu()
{
ASSERT_VALID( this );
VERIFY( _UpdateDurationFromOleDateTime( true ) );
DWORD dwDatePickerStyle = OnDropDownCalendarQueryStyle();
CExtPopupDatePickerMenuWnd * pPopup =
new CExtPopupDatePickerMenuWnd(
0L,
CSize(1,1),
WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN,
dwDatePickerStyle
);
if( !pPopup->CreatePopupMenu( GetSafeHwnd() ) )
{
ASSERT( FALSE );
delete pPopup;
return false;
}
CRect rcClient;
GetClientRect( &rcClient );
ClientToScreen( &rcClient );
CPoint ptTrack(
rcClient.right,
rcClient.bottom
);
ptTrack.x +=
pPopup->OnQueryMenuShadowSize();
CRect rcExclude( ptTrack, ptTrack );
if( ! pPopup->TrackPopupMenu(
TPMX_RIGHTALIGN,
ptTrack.x,
ptTrack.y,
rcExclude,
this,
NULL,
NULL,
true
)
)
{
ASSERT( FALSE );
delete pPopup;
return false;
}
return true;
}
|
|
Francesco Toscano
|
Jan 21, 2008 - 12:20 PM
|
Is it possible to store the current displayed order of the columns of "CExtGridWnd", that is changed after column header drag and drop?
Thank ... many many thanks for your great support.
|
|
Technical Support
|
Jan 24, 2008 - 12:54 AM
|
The main question is how to identify each column after it was created and its position has been changed by the user. All cell classes have the LParamSet() and LParamGet() methods. This allows you to assign some user data. So just use these parameters to mark your header cells with some unique data.
Then you need to save/restore information about the column order. We don’t have a ready-to-use solution for this but we have another solution. In some of our projects we use the code below which saves column widths in a string. This string can be saved in the registry. Then we restore columns width using information from the parsed string. You can use this code as a sample. bool CBaseGridWnd::LoadColumnWidths()
{
ASSERT_VALID( this );
CSettings cfg;
CString sWidths;
if( !cfg.GetGridColumnWidths(
sWidths,
m_sSection,
m_sEntry
)
)
return false;
if( sWidths.IsEmpty() )
return false;
CString sToken;
LONG nColNo = 0;
LONG nColumnCount = ColumnCountGet();
for( INT i = 0; i < sWidths.GetLength(); i++ )
{
if( nColNo > nColumnCount - 1 )
break;
if( sWidths.GetAt( i ) != _T(’;’) )
{
sToken += sWidths.GetAt( i );
}
else
{
CExtGridCellHeader * pCell =
STATIC_DOWNCAST(
CExtGridCellHeader,
GridCellGetOuterAtTop(
nColNo,
0L,
RUNTIME_CLASS( CExtGridCellHeader )
)
);
if( pCell != NULL )
{
ASSERT_VALID( pCell );
INT nItemExtent = _ttoi( sToken );
pCell->ExtentSet( nItemExtent );
}
sToken = _T("");
nColNo++;
}
}
return true;
}
bool CBaseGridWnd::SaveColumnWidths()
{
ASSERT_VALID( this );
if( !m_bEnableSaveRestore )
return false;
CString sWidths;
LONG nColumnCount = ColumnCountGet();
for( LONG nColNo = 0L; nColNo < nColumnCount; nColNo++ )
{
CExtGridCellHeader * pCell =
STATIC_DOWNCAST(
CExtGridCellHeader,
GridCellGetOuterAtTop(
nColNo,
0L,
RUNTIME_CLASS( CExtGridCellHeader )
)
);
if( pCell != NULL )
{
ASSERT_VALID( pCell );
INT nItemExtent = 0;
if( pCell->ExtentGet( nItemExtent ) )
{
CString s;
s.Format( _T("%d;"), nItemExtent );
sWidths += s;
}
}
}
CSettings cfg;
if( !cfg.SetGridColumnWidths(
sWidths,
LPCTSTR( m_sSection ),
LPCTSTR( m_sEntry )
)
)
return false;
return true;
}
|
|
Simon DESEE
|
Jan 21, 2008 - 4:04 AM
|
Dear Support,
I’ve sent to you a mail some days ago with some source files (as you asked me for this).
I never received any notification of receipt. Did you receive my mail ?
Just to know if I must resend my mail or not.
Thanks
|
|
Technical Support
|
Feb 8, 2008 - 3:47 AM
|
We are really sorry for this delay. We found what is wrong and sent you two replies by email.
|
|
Mitsuhiko Yamada
|
Jan 21, 2008 - 2:22 AM
|
Hello. I have used profUIS under VisualStudio2005(Japanese) up to now. It was necessary to change in the content of \Prof-UIS\Include\Resources\resource.rc to avoid the crash of VisualStudio2005(Japanese) at the build of project. When having updated it to profUIS(2.82), I can do the build of various projects. VisualStudio2005(Japanese) crashes by the debugging execution. Next, when having changed to VisualStudio2008(Japanese), I cannot do the build of samples(SDI, MDI, ProfUIS_Controls...) of profUIS. VisualStudio2008(Japanese) crashes. Moreover, ProfUisAppWizard_2005 doesn’t operate. Isn’t there problem in the use of profUIS(2.82) under VisualStudio2008(Japanese)? Or, is special attention in use necessary?
|
|
Bangjun Lei
|
Jan 19, 2008 - 4:17 AM
|
Dear Sir./Madam.,
I successfully used your system to develope my software. The developed software works pretty good on my computer (English WinXP). However, when I bring my software to some other systems for example a Chinese WinXP. It turns out the font becomes bigger and therefore quite some of my CExtLabel objects are not displayed correctly (the texts simply run out of the boundary and therefore the ends are not displayed).
Do you have any solutions for this? I noticed in your FunnyBar example when you change the font all controls can automatically resize to adjust automatically with the font size change. Can you show me how I can achieve this step by step ?
Thanks very much!
|
|
Technical Support
|
Jan 19, 2008 - 12:13 PM
|
Menus, toolbars and menu bar windows automatically compute their layouts. These windows are designed to have computable on-the-fly sizes even without ability to specify their initial or persistent sizes. The dialog child controls are created using preliminary known sizes in DLUs (dialog units dependent on the font property of the dialog template resource). If you create two versions of some dialog template resource for two different languages (English and Chinese) and specified different texts and sizes for labels on the dialog form, then you will see the correctly displayed dialog in both languages. If you are talking about one label control with some initially set English text and sizes and then you assign Chinese text to it using CWnd::SetWindowText() MFC API or ::SetWindowText() Win32 API, then you are also responsible to resize this label window for making it displaying the new text correctly.
|
|
Paul Cowan
|
Jan 18, 2008 - 1:03 PM
|
How can I create a multi text row header cells for the data grid? I have column title that a longer then the column contents and I would like to make the header row double height and have a text wrap.
|
|
Technical Support
|
Jan 19, 2008 - 12:17 PM
|
You should use an ordinary CExtGridCellHeader cell object in the header row and apply the __EGCS_EX_WRAP_TEXT extended cell style: pCell->ModifyStyleEx( __EGCS_EX_WRAP_TEXT ); Then you can assign multiline text with \n line separator characters to this header grid cell and it will be displayed as multiline. Finally you should make the outer header row having an enough large height to make all the multiline strings completely visible. You can do this using the CExtGridWnd::OuterRowHeightSet() method, which sets the desired height of outer header row in pixels. The CExtGridWnd::BestFitRow() method allows you to measure the height of any row (inner data row or outer header row) and apply it.
|
|
Chris Anderson
|
Jan 18, 2008 - 11:14 AM
|
We have a "dockable dialog box" in our legacy app, to make it dockable with prof-ui, we created a CExtControlBar as the parent of the dialog box. It’s working fine but we noticed a bit different behavior: the user is not able to dock the "dialog box ( actually the control bar)" by double clicking the title bar any more, the only way is "drag and drop".
I didn’t find any flag or property to enable this behavior so i tried a few things to make the double clicking work. This is what I did in the experiment: - derived a minidock frame window class from CExtMiniDockFrameWnd, and override the OnNcLButtonDblClk() function. The point is to call the MFC version of OnNcLButtonDblClk() .
class CMyDockMiniFrameWnd : public CExtMiniDockFrameWnd { ... afx_msg void OnNcLButtonDblClk(UINT nHitTest, CPoint point); };
void CMyDockMiniFrameWnd ::OnNcLButtonDblClk(UINT nHitTest, CPoint point) { // call MFC function to enable double click return CMiniDockFrameWnd::OnNcLButtonDblClk(nHitTest, point); }
- derived a control bar from CExtControlBar class and override the FloatControlBar() . The point is to create a mini dock frame wnd with a different OnNcLButtonDblClk() funtion. class CMyControlBar : public CExtControlBar { ... irtual void FloatControlBar( CPoint ptFloat, DWORD dwStyle = CBRS_ALIGN_TOP ); }
void CMyControlBar::FloatControlBar( CPoint ptFloat, DWORD dwStyle = CBRS_ALIGN_TOP ) { // create CMyDockMiniFrameWnd instead of CExtMiniDockFrameWnd }
Except the dialog box is occasionally docked above the menu bar, this seems to work fine. Is this a feasible way? Could you provide some inputs ?
thanks
|
|
Chris Anderson
|
Jan 18, 2008 - 12:25 PM
|
thanks for the information. do you guys have any plan to implement this in the future ?
|
|
Technical Support
|
Jan 18, 2008 - 11:35 AM
|
At the moment this feature is not supported for resizable control bars.
|
|
Ian McIntosh
|
Jan 18, 2008 - 11:12 AM
|
I create some toolbars dynamically using create.
When I right click on the status bar, I get a list of Control Bars and Tool Bars that should be enabled. All the Control Bars are enabled but my toolbars are not.
What am I doing wrong?
other info: profUIS v2.81 dwStyle parameter is left as default
|
|
Technical Support
|
Jan 18, 2008 - 11:35 AM
|
We guess you may have forgotten to insert message map entries for each of your control bars: ON_COMMAND_EX(ID_VIEW_MENUBAR, OnBarCheck )
ON_UPDATE_COMMAND_UI(ID_VIEW_MENUBAR, OnUpdateControlBarMenu) Please also check whether each bar has a unique identifier.
|
|
tera t
|
Jan 18, 2008 - 2:01 AM
|
Hello.
At the time of printing I want to set the paper of the printer in A3. Will CExtPPVW be possible?
|
|
tera t
|
Jan 20, 2008 - 5:54 PM
|
|
|
Technical Support
|
Jan 18, 2008 - 11:34 AM
|
The CExtPPVW_Printable::OnPreparePrinting() method uses CWinApp::GetPrinterDeviceDefaults() to retrieve the printer settings. So you should simply configure the default printer for using A3 format before printing/previewing.
|
|
tera t
|
Jan 17, 2008 - 7:50 PM
|
Hello.
In Drawvw.cpp, will CExtScrollBar be utilized? Or will standard CSrollBar be utilized? When I click scroll bar, a bar shines for an instant. Do you do any special thing?
|
|
Technical Support
|
Jan 19, 2008 - 12:21 PM
|
Please follow these steps for improving the source code of your scrollable view window:
1) The scrollbar creation code should be: m_wndScrollBarH.m_eSO = CExtScrollBar::__ESO_BOTTOM;
m_wndScrollBarV.m_eSO = CExtScrollBar::__ESO_RIGHT;
if( ! m_wndScrollBarV.Create(
WS_CHILD|WS_VISIBLE|SBS_VERT|SBS_RIGHTALIGN,
CRect(0,0,0,0),
this,
1
)
)
{
ASSERT( FALSE );
return -1;
}
if( ! m_wndScrollBarH.Create(
WS_CHILD|WS_VISIBLE|SBS_HORZ|SBS_BOTTOMALIGN,
CRect(0,0,0,0),
this,
2
)
)
{
ASSERT( FALSE );
return -1;
}
m_wndScrollBarH.SyncReservedSpace( &m_wndScrollBarV );
m_wndScrollBarV.SyncReservedSpace( &m_wndScrollBarH );
RepositionBars( 0, 0xFFFF, 0 ); 2) The OnSize() , OnHScroll() and OnVScroll() handler methods should finally invoke the following: RepositionBars( 0, 0xFFFF, 0 );
3) A bit better implementation of the CWnd::GetScrollBarCtrl() virtual method (though your current version is OK): CScrollBar * CSkeViewPPW::GetScrollBarCtrl( int nBar ) const
{
ASSERT_VALID( this );
if( m_hWnd == NULL || (! ::IsWindow(m_hWnd) ) )
return NULL;
if( nBar == SB_HORZ )
{
if( m_wndScrollBarH.GetSafeHwnd() != NULL )
return ( const_cast < CExtScrollBar * > ( &m_wndScrollBarH ) );
}
else if( nBar == SB_VERT )
{
if( m_wndScrollBarV.GetSafeHwnd() != NULL )
return ( const_cast < CExtScrollBar * > ( &m_wndScrollBarV ) );
}
return NULL;
} 4) The CView::OnScroll() and CView::OnScrollBy() virtual methods should be overridden in your view window. BOOL CSkeViewPPW::OnScroll( UINT nScrollCode, UINT nPos, BOOL bDoScroll /*= TRUE*/ )
{
ASSERT_VALID( this );
bDoScroll;
BOOL bRetVal = CScrollView::OnScroll( nScrollCode, nPos, FALSE );
Invalidate();
return bRetVal;
}
BOOL CSkeViewPPW::OnScrollBy( CSize sizeScroll, BOOL bDoScroll /*= TRUE*/ )
{
ASSERT_VALID( this );
bDoScroll;
INT xOrig, x, yOrig, y, xMax = GetScrollLimit( SB_HORZ ), yMax = GetScrollLimit( SB_VERT );
xOrig = x = GetScrollPos(SB_HORZ);
yOrig = y = GetScrollPos(SB_VERT);
DWORD dwStyle = GetStyle();
CScrollBar * pBarH = GetScrollBarCtrl( SB_HORZ ), * pBarV = GetScrollBarCtrl( SB_VERT );
if( ( pBarH != NULL && (!pBarH->IsWindowEnabled()) )
|| ( pBarH == NULL && (dwStyle&WS_HSCROLL) != 0 )
)
sizeScroll.cx = 0;
if( ( pBarV != NULL && (!pBarV->IsWindowEnabled()) )
|| ( pBarV == NULL && (dwStyle&WS_VSCROLL) != 0 )
)
sizeScroll.cy = 0;
x += sizeScroll.cx;
if( x < 0 )
x = 0;
else if( x > xMax )
x = xMax;
y += sizeScroll.cy;
if( y < 0 )
y = 0;
else if( y > yMax )
y = yMax;
if( x == xOrig && y == yOrig )
return FALSE;
if( x != xOrig )
SetScrollPos( SB_HORZ, x );
if( y != yOrig )
SetScrollPos( SB_VERT, y );
Invalidate();
return TRUE;
}
|
|
tera t
|
Jan 18, 2008 - 5:22 PM
|
Hello.
I programed it as follows. However, the scroll bar is displayed, but does not work.
class MT_EXPORT CSkeViewPPW : public CExtPPVW < CScrollView > { ...........................................
}
CScrollBar * CSkeViewPPW::GetScrollBarCtrl( int nBar ) const { ASSERT_VALID( this ); if( m_hWnd == NULL || (! ::IsWindow(m_hWnd) ) ) return NULL; ASSERT( nBar == SB_HORZ || nBar == SB_VERT ); if( nBar == SB_HORZ ) { if( m_wndScrollBarH.GetSafeHwnd() != NULL ) return ( const_cast < CExtScrollBar * > ( &m_wndScrollBarH ) ); } // if( nBar == SB_HORZ ) else { if( m_wndScrollBarV.GetSafeHwnd() != NULL ) return ( const_cast < CExtScrollBar * > ( &m_wndScrollBarV ) ); } // else from if( nBar == SB_HORZ ) return NULL; }
void CSkeViewPPW::OnInitialUpdate() { m_wndScrollBarH.m_eSO = CExtScrollBar::__ESO_BOTTOM; m_wndScrollBarV.m_eSO = CExtScrollBar::__ESO_RIGHT; if( ! m_wndScrollBarV.Create( WS_CHILD|WS_VISIBLE|SBS_VERT|SBS_RIGHTALIGN, CRect(0,0,0,0), this, 1 ) ) { ASSERT( FALSE ); return; } if( ! m_wndScrollBarH.Create( WS_CHILD|WS_VISIBLE|SBS_HORZ|SBS_BOTTOMALIGN, CRect(0,0,0,0), this, 2 ) ) { ASSERT( FALSE ); return; } m_wndScrollBarH.SyncReservedSpace( &m_wndScrollBarV ); m_wndScrollBarV.SyncReservedSpace( &m_wndScrollBarH );
CSize sizeTotal(1,1); CSize Page(100,50); CSize Line(10,10); SetScrollSizes(MM_TEXT, sizeTotal /*,Page,Line*/ );
}
void CSkeViewPPW::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) { pScrollBar = GetScrollBarCtrl( SB_HORZ ); CExtPPVW < CScrollView >::OnHScroll(nSBCode, nPos, pScrollBar);
Invalidate(); UpdateWindow(); }
void CSkeViewPPW::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) { pScrollBar = GetScrollBarCtrl( SB_VERT ); CExtPPVW < CScrollView >::OnVScroll(nSBCode, nPos, pScrollBar);
Invalidate(); UpdateWindow(); }
Thank you
|
|
Technical Support
|
Jan 18, 2008 - 11:06 AM
|
The view window in this sample application is based on the CExtSplitterWnd splitter window which uses CExtScrollBar scroll bars controls instead of MFC’s CScrollBar . You can use a CExtScrollBar control independently of any Prof-UIS classes. This is simply a repainted version of CScrollBar which also supports themed animations.
|
|
Herve Dumont
|
Jan 17, 2008 - 4:02 AM
|
We migrated from Prof UIs 2.71 to 2.82 and we noticed Ribbon/MDI window problem If I run RibbonBarMDI sample, create a new document, The document is maximized and the Close/restore buttons for this document are not visible left to the info button.
|
|
Herve Dumont
|
Jan 24, 2008 - 7:57 AM
|
The registry was the trick. After removing registry entry, restore buttons reappeared.
|
|
Technical Support
|
Jan 23, 2008 - 12:20 PM
|
First of all, please rebuild both Prof-UIS and your project completely. Second, please remove the control bar state persistence data from the system registry. Third, if the first and second steps do not help, please request the latest source by email.
|
|
Herve Dumont
|
Jan 23, 2008 - 7:51 AM
|
I applied the patch, but the problem still persist
|
|
Technical Support
|
Jan 19, 2008 - 7:48 AM
|
It seems this "feature" was added during final testing of 2.82. Please update the source code for the following method: void CExtRibbonPage::_DelayUpdateMenuBar()
{
ASSERT_VALID( this );
CExtMenuControlBar::_DelayUpdateMenuBar();
}
|
|
Thomas Hsieh
|
Jan 17, 2008 - 1:57 AM
|
I created a cloumn with check box cell in report grid window. However, the checked icon seems using the wrong png file in skin file. It uses disabled png file to display the checked icon. But the checkbox button control is work well in dialog.
After I copied the normal checked png file into "Button\CheckAndRadio\Check\Disabled" directory in skin file directory. And it will show the enabled checked png file. There seems something wrong to display checkbox cell in skin. Please help to check whether there exist such bug in prof-UIS.
Thanks a lot.
---- Followings are the code to create checkbox cell in report grid window: CExtGridCellCheckBox* pCheckBoxCell = (CExtGridCellCheckBox*)ReportItemGetCell( pRGC, pRGI, RUNTIME_CLASS(CExtGridCellCheckBox) ); ASSERT_VALID( pCheckBoxCell ); pCheckBoxCell->SetCheck( BST_CHECKED ); pCheckBoxCell->ModifyStyle(__EGCS_NO_INPLACE_CONTROL|__EGCS_ICA_HORZ_CENTER|__EGCS_ICA_VERT_CENTER);
|
|
Technical Support
|
Jan 21, 2008 - 2:42 AM
|
Thank you for reporting the bug. You can fix it in this way.
1) Open the CExtGridCell::OnPaintCheck() method and find the following code snippet: CExtPaintManager::PAINTCHECKRADIOBUTTONDATA _pcrbd;
_pcrbd.m_pHelperSrc = (CObject*)&wndGrid;
_pcrbd.m_rcClient = rcCell;
_pcrbd.m_rcBox = rcBox; 2) Replace it with this one: CExtPaintManager::PAINTCHECKRADIOBUTTONDATA _pcrbd;
_pcrbd.m_pHelperSrc = (CObject*)&wndGrid;
_pcrbd.m_rcClient = rcCell;
_pcrbd.m_rcBox = rcBox;
_pcrbd.m_bEnabled = bEnabled;
_pcrbd.m_bPushed = bPressed;
_pcrbd.m_bHover = bHovered; 3) Recompile the library.
|
|
Francesco Toscano
|
Jan 16, 2008 - 11:29 AM
|
I would like to save the sort order state of the columns of my derived "CExtGridWnd" in the windows registry, is it possible?
Then supposing that it is possible, I know that I can use "CExtGridWnd::GridSortOrderGet(...)" to get the sort order and "CExtGridWnd::GridSortOrderSetup(...)" to apply the previous saved order next time to the grid.
But How can I check if the number of the columns which the sort order is refered is changed? In other words: suppose that I save the columns order for a grid that have 5 columns, at the next time the application it is executed the grid has changed ( ..for some reasons... ), the columns number. Whats happens if I try to apply the previous saved column order states? How can I check that the saved sort order refers to a grid condition that do not exist anymore?
thanks in advance!
|
|
Technical Support
|
Jan 17, 2008 - 3:50 AM
|
The CExtGridDataSortOrder class supports an CArchive -based serialization through its Serialize() method. You should create an CArchive object based on a CMemFile object and serialize a CExtGridDataSortOrder object. You can use the CExtCmdManager::FileObjToRegistry() and CExtCmdManager::FileObjFromRegistry() methods for loading the content of the CMemFile object from the registry or writing it to the registry. There is a CExtCmdProfile::SerializeState() which you can use as a good example of registry-based serialization. Of course, you should ensure that the CExtGridDataSortOrder data loaded from the registry corresponds to the columns of your grid window. So, you may need to serialize some additional information to the same CArchive object. This information can describe column count, column names, etc.
|
|
Dominik Braendlin
|
Jan 16, 2008 - 3:26 AM
|
CExtControlBar::ProfileBarStateLoad fails if I add or remove control bars. I have searched the forum and have found other people facing the same problem. http://www.prof-uis.com/Forum_View.aspx?CID=40&M=6269&s=CExtControlBar%3a%3aProfileBarStateLoad I was wondering if with version 2.82 of the library the handling of the control bars is still the same as described in the link above. How should I handle the dynamic adding and removing of control bars? Let’s say the application may start up with a different set of control bars depending on a config file. This config file may change from application start to application start. Cheers Adrian
|
|
Technical Support
|
Jan 17, 2008 - 3:56 AM
|
You should not encounter any crashes with v.2.82. But Prof-UIS still requires the exact matching between the state data and the control bars created in the main frame window.
|
|
tera t
|
Jan 16, 2008 - 3:03 AM
|
Hello.
In OnPreparePrinting (Func) , I want to acquire hDC of a printer choosing now.
|
|
Technical Support
|
Jan 17, 2008 - 3:57 AM
|
First of all, you should invoke the parent class method. Then the pInfo->m_pPD->m_pd.hDC variable will specify the handler of printer’s device context.
|
|
Torsten Schucht
|
Jan 15, 2008 - 12:12 PM
|
Hello Support Team,
I am using your CIconListBox from the IconEditor Example. The box works fine, but it does not use the paint manager for the scrollbar. Some time ago you have send me a template class which make themed scrollbars available to the CExtGridWnd. That template does not work with the CIconListbox: template < class _BT > class CExtNicerScrollBarsT : public _BT { public: mutable CExtScrollBar m_wndScrollBarH, m_wndScrollBarV; protected: bool _EnsureScrollBarsCreated() const { if( m_wndScrollBarH.GetSafeHwnd() != NULL && m_wndScrollBarV.GetSafeHwnd() != NULL ) return true; m_wndScrollBarH.m_eSO = CExtScrollBar::__ESO_BOTTOM; m_wndScrollBarV.m_eSO = CExtScrollBar::__ESO_RIGHT; if( m_wndScrollBarV.GetSafeHwnd() == NULL ) { if( ! m_wndScrollBarV.Create( WS_CHILD|WS_VISIBLE|SBS_VERT|SBS_RIGHTALIGN, CRect(0,0,0,0), ((CWnd*)this), 1 ) ) { ASSERT( FALSE ); return false; } } if( m_wndScrollBarH.GetSafeHwnd() == NULL ) { if( ! m_wndScrollBarH.Create( WS_CHILD|WS_VISIBLE|SBS_HORZ|SBS_BOTTOMALIGN, CRect(0,0,0,0), ((CWnd*)this), 2 ) ) { ASSERT( FALSE ); return false; } } m_wndScrollBarH.SyncReservedSpace( &m_wndScrollBarV ); m_wndScrollBarV.SyncReservedSpace( &m_wndScrollBarH ); return true; } public: virtual CScrollBar* GetScrollBarCtrl(int nBar) const { ASSERT_VALID( this ); switch( nBar ) { case SB_HORZ: case SB_VERT: if( _EnsureScrollBarsCreated() ) { CExtScrollBar * pScrollBar = ( nBar == SB_HORZ ) ? (&m_wndScrollBarH) : (&m_wndScrollBarV); ASSERT_VALID( pScrollBar ); ASSERT( pScrollBar->GetSafeHwnd() != NULL ); return pScrollBar; } break; } return NULL; } };
In our case the CIconListbox is derived from CListBox and COleDropTarget (to support Drag’n’Drop).
Do you have a suggestion, what I should do?
Thanks in advance.
Torsten
|
|
Technical Support
|
Mar 17, 2008 - 11:08 AM
|
The scroll bars are already skinned in Prof-UIS 2.83, including the ProfSkin library and default window non client area scroll bars. You can see skinned scroll bars of common controls in the following sample application:
TestSkinnedNcScrollBars.zip
The list box in the main dialog has a skinned scroll bar. The date picker related dialog page has an edit control with skinned scroll bars. The date browser related dialog page has a rich edit control with skinned scroll bars. The grid related dialog page has a popup list box with skinned scroll bars displayed for font face name selection grid cells.
|
|
Torsten Schucht
|
Mar 14, 2008 - 3:57 AM
|
I don’t want to put the bite on you, but your last post is now older than a month and you told me that you would have a solution within ca. 10 days. Could please give me an update on the schedule ?
Thx Torsten
|
|
Technical Support
|
Feb 5, 2008 - 11:31 AM
|
We are working on skinned built-in scroll bars for all controls in Prof-UIS and the update will be available in approximately ten days. We will provide you with this update as soon as it is ready.
|
|
Torsten Schucht
|
Feb 5, 2008 - 2:53 AM
|
Thanks for that information. This works quite good. But there is one issue we have not been able to resolve. We have a resizeable dialog (CExtResizableDialog) (DlgA) which embedds another resizeable dialog (DlgB). Both dialogs use anchoring for correct resizig. The resizing works fine for DlgA and DlgB. When we now add a skinned Listbox to DlgB, the resizing stops working for DlgB but is still working for DlgA. This problem does not occur, if we insert a skinned listbox directly in DlgA without having an embedded DlgB.
Any ideas?
Torsten
|
|
Technical Support
|
Jan 17, 2008 - 4:00 AM
|
The CExtNicerScrollBarsT template class (the CExtNSB template class inside Prof-UIS 2.82) is designed to be used with CExtScrollWnd -derived classes like CExtGridWnd . This class uses two scroll bar common controls. All the scrollable common controls (list view, tree view, and list box) are not designed to be used with scroll bar common controls. They rather use a scroll bar like window non-client areas. We are working on an improvement for the CExtNCW template class so it will enable you to work with child windows and replace their scroll bar like areas. At this moment you can try the following solution:
http://www.codeproject.com/KB/dialog/skinscrollbar.aspx
And try the following test project that is based on it but that uses Prof-UIS skinned scroll bars:
http://www.prof-uis.com/download/forums/SkinnedScrollBars.zip
|
|
Ian McIntosh
|
Jan 15, 2008 - 7:44 AM
|
It seems that using DockControlBarInnerOuter causes a CExtControlBar to no longer be accessible using GetDlgItem.
in the following code: CWnd* pWnd = GetDlgItem(ID_SYSTEM_TREE); m_barSystemTree.DockControlBarInnerOuter( AFX_IDW_DOCKBAR_LEFT, true ); pWnd = GetDlgItem(ID_SYSTEM_TREE);
pWnd returned by the first GetDlgItem is populated, but the second GetDlgItem returns NULL.
Is this correct? What is the best way to access a CExtControlBar from its ID?
|
|
Dave Foster
|
Sep 15, 2009 - 8:40 PM
|
CMainWnd::DockControlBar( m_ToolBar, AFX_IDW_DOCKBAR_LEFT, &rect ) appears to undesirably resize our m_ToolBar when docked. This did not occur when running with an MFC CToolBar. m_ToolBar is an instance of CExtToolControlBar which was constructed with a 6 or so buttons (implemented from a bitmap), two CExtComboBox items and two CStatic objects inserted dynamically (they were "created", then "positioned" on the m_ToolBar). I have read that one should use CExtToolControlBar::DockControlBar() instead of CMainWnd::DockControlBar(), but I cannot see the equivelent functionality in the CExtControlBar class. Thanks
|
|
Technical Support
|
Sep 17, 2009 - 3:01 AM
|
The CExtControlBar::Dock***() methods should be used with CExtControlBar resizable control bars. The CFrameWnd::DockControlBar() method should be used with CExtToolControlBar , CExtMenuControlBar , CExtPanelControlBar panel bars and other fixed size bars which cannot be resized by the user when docked.
The problem is to do with something else. Please drop an e-mail to the support mail box at this web site and attach the source code of your classes mentioned in your forum message and the source code of the main frame class.
|
|
Ian McIntosh
|
Jan 15, 2008 - 10:13 AM
|
|
|
Technical Support
|
Jan 15, 2008 - 10:07 AM
|
The CFrameWnd::m_listControlBars list object contains CControlBar* pointers to all control bars created in this frame window (including dock bars). You can use this list for enumerating all the control bars. The CFrameWnd::GetControlBar() method can be used for retrieving a CControlBar* pointer by its identifier.
|
|
Suhai Gyorgy
|
Jan 15, 2008 - 8:05 AM
|
GetDlgItem searches the immediate child windows for the given ID. But docking the bar changes its parent (Check out ProfUIS article Docking Mechanism Explained)
You might want to try AfxGetMainWnd()->GetDescendantWindow(ID_SYSTEM_TREE) method, which searches all descendants for the given ID. But I’m not sure if it’s safe in all situations (let’s say when the control bar is in floating state).
|
|
Dominik Braendlin
|
Jan 15, 2008 - 6:57 AM
|
Dear Tech support In an MDI mfc project that I am currently working on I am facing an MDI-Window menu problem. If the top menu name is [&Window] the MDI window list is inserted properly in the sub menu. If the top menu name is other than [&Window] the sub menu does not contain any of the MDI child windows not even the [More Windows…] entry if there is more than 9 windows. In a pure mfc project the window menu is not assigned according to the name but according to the MDI window menu relevant resource ids (see GetWindowMenuPopup()). I am currently using the Prof-UIS lib v 2.82 static linked [yu]. Is there anything that the Prof lib is doing in a different way tha pure mfc to get the MDI window menu? Does this functionality also depend on any localizing issue? Best Regards Adrian
|
|
Technical Support
|
Jan 15, 2008 - 10:10 AM
|
The MFC simply modifies the second from right popup menu in the menu bar which is often MDI window menu but not always. Prof-UIS uses a different approach. You should specify an MDI window menu item in the menu bar: m_wndMenuBar.SetMdiWindowPopupName( _T("Window") );
if( ! m_wndMenuBar.Create( NULL, this, ID_VIEW_MENUBAR ) )
{
TRACE0("Failed to create menu bar\n");
return -1; // failed to create
} You can specify your preferred or localized MDI menu name.
|
|
Dominik Braendlin
|
Jan 15, 2008 - 6:57 AM
|
Dear Tech support In an MDI mfc project that I am currently working on I am facing an MDI-Window menu problem. If the top menu name is [&Window] the MDI window list is inserted properly in the sub menu. If the top menu name is other than [&Window] the sub menu does not contain any of the MDI child windows not even the [More Windows…] entry if there is more than 9 windows. In a pure mfc project the window menu is not assigned according to the name but according to the MDI window menu relevant resource ids (see GetWindowMenuPopup()). I am currently using the Prof-UIS lib v 2.82 static linked [yu]. Is there anything that the Prof lib is doing in a different way tha pure mfc to get the MDI window menu? Does this functionality also depend on any localizing issue? Best Regards Adrian
|