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 |
|
|
L Freddi
|
Jul 28, 2009 - 5:22 AM
|
Hello support. I’ using many CExtControlbar and need to update UI while resizing the controlbar. How to check the event while resizing the CExtControlbar. One more. CExtContolbar can be dock/undock/drag&drop in the application. Sometimes CExtControlbar moving is not smooth when i drag the Controlbar.
|
|
|
Technical Support
|
Jul 28, 2009 - 8:43 AM
|
You can use a CExtControlBar-derived class which implements the following virtual method: virtual void OnControlBarPositionChange(
CExtControlBar * pBarEventSrc,
e_control_bar_position_changing_t eCBPC,
bool bInitial,
bool bFinal
);
This method is invoked when the control bar is resized and redocked. The eCBPC parameter defines how the position of the control bar changes. The e_control_bar_position_changing_t enumeration is defined in scope of the CExtControlBar class: enum e_control_bar_position_changing_t
{
__ECBPC_EMPTY = 0,
__ECBPC_REDOCKING = 1,
__ECBPC_ROW_RESIZING = 2,
__ECBPC_IN_ROW_RESIZING = 3,
__ECBPC_FLOATING_FRAME_RESIZING = 4,
__ECBPC_MUTUAL_DEPENDENCY = 5,
};
|
|
|
Bart Kampers
|
Jul 27, 2009 - 8:25 AM
|
Hello,
I derived my class from CExtGridCellButton like this:
// header file class CFlushCell : public CExtGridCellButton { public: DECLARE_SERIAL(CFlushCell) IMPLEMENT_ExtGridCell_Clone(CFlushCell, CExtGridCellButton); CFlushCell(CExtGridDataProvider* pDataProvider = NULL) : CExtGridCellButton(pDataProvider) {}
virtual void OnButtonPressed(CExtGridWnd & wndGrid, INT nButtonType, const RECT & rcCellExtra, const RECT & rcCell, LONG nVisibleColNo, LONG nVisibleRowNo, LONG nColNo, LONG nRowNo, INT nColType, INT nRowType) {} };
// cpp file IMPLEMENT_SERIAL(CFlushCell, CExtGridCellButton, VERSIONABLE_SCHEMA | 1)
When I compile this I get:
Error 254 error C2665: ’CExtGridCell::operator new’ : none of the 2 overloads could convert all the argument types d:\development\efg400_trunk\EFG400\Software\NewGui\ExitControlStateGrid.cpp 38
I did this in some other projects in exactly the same way where it gave no problems at all. Why do I get an error now?
Thanks in advance,
Bart.
|
|
|
Technical Support
|
Jul 27, 2009 - 12:04 PM
|
The IMPLEMENT_SERIAL statement should be placed at the very beginning of the CPP file before the declaration of MFC’s debug version of C++ new operator: IMPLEMENT_SERIAL(CFlushCell, CExtGridCellButton, VERSIONABLE_SCHEMA | 1)
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
The CExtGridCell class defines its own versions of the C++ new and delete operators. The MFC’s debug versions of these operators are incompatible with in-class defined operators.
|
|
|
Anil Siddhpura
|
Jul 24, 2009 - 1:04 AM
|
Hi,
How can i add footer in reports in each page??
Or is it possible to add footer on only last page of report??
|
|
|
Technical Support
|
Jul 29, 2009 - 11:01 AM
|
The header/footer feature is to be appear in the next version 2.87.
|
|
|
Technical Support
|
Jul 27, 2009 - 12:06 PM
|
We are working on the "HTML everywhere" feature which assumes support of HTML based rich text everywhere you currently see only plain single font text. We hope it will be included into nearest release and we are planning to enable HTML based page headers and footers in the printing/previewing subsystem.
|
|
|
Anil Siddhpura
|
Jul 29, 2009 - 12:07 AM
|
Hi,
I thought you have already implemented Footer in ver 2.85, as you have previously told me.
I am using CExtReportGrid to generate the reports. And i want to add footer in printpreview, or it’s fine if i can add a single line at the end of reports(On the last page of report) .
Thanks
|
|
|
Bart Kampers
|
Jul 22, 2009 - 6:42 AM
|
Hello,
Is it possible to have a grid cell with an icon and text. I tried the code below but this only shows the icon...
CExtGridCellPicture* cell = (CExtGridCellPicture*) GridCellGet(col, row, 0, 0, RUNTIME_CLASS(CExtGridCellPicture));
if (cell != NULL)
{
cell->ModifyStyle(__EGCS_ICA_HORZ_LEFT);
cell->ImageModeSet(CExtGridCellPictureBase::eAlign);
cell->BitmapSet(bitmap);
cell->TextSet(text);
SetBackground(cell, row);
}
|
|
|
Technical Support
|
Jul 22, 2009 - 12:46 PM
|
The CExtGridCellPicuture*** grid cell classes display an image only. They are designed to display a picture inside the entire cell area. You should use the CExtGridCellString simple text grid cell. The CExtGridCell::TextSet() method assigns a cell text. The CExtGridCell::IconIndexSet() method assigns an icon index. The icon should be preliminary registered in the grid control using the CExtGridWnd::GridIconInsert() method which returns a registered icon index.
|
|
|
Christian Gross
|
Jul 20, 2009 - 7:06 PM
|
Hello Prof-UIS team, i’m using ImageModeSet() to stretch or tile a CExtBitmap object assigned with LoadBMP_Resource() to the cell. Vertically the image touches the borders but not horizontally. There seems to be a 2 pixel gap left and right of the image. How can this gap be removed? Thanks & regards, Chris
|
|
|
Chris G.
|
Jul 21, 2009 - 1:08 PM
|
Thank you, the fix now works for stretched images. But for tiled ones there still exist the same gaps. Regards, Chris
|
|
|
Technical Support
|
Jul 22, 2009 - 12:48 PM
|
We assume the stretched mode is special. The gaps or borders can be useful because the show selection background and/or focus rectangle.
|
|
|
Technical Support
|
Jul 21, 2009 - 8:51 AM
|
Thank you for reporting this issue. We fixed it in the following method: void CExtGridCellPictureBase::OnPaintText(
const RECT & rcCellText,
const CExtGridWnd & wndGrid,
CDC & dc,
LONG nVisibleColNo,
LONG nVisibleRowNo,
LONG nColNo,
LONG nRowNo,
INT nColType,
INT nRowType,
const RECT & rcCellExtra,
const RECT & rcCell,
const RECT & rcVisibleRange,
DWORD dwAreaFlags,
DWORD dwHelperPaintFlags
) const
{
ASSERT_VALID( this );
ASSERT_VALID( (&wndGrid) );
ASSERT( dc.GetSafeHdc() != NULL );
if( ! dc.RectVisible( &rcCellText ) )
return;
wndGrid; nVisibleColNo; nVisibleRowNo; nColNo; nRowNo; nColType; nRowType; rcCellExtra; rcCell; rcVisibleRange; dwAreaFlags; dwHelperPaintFlags;
if( IsInvisible() || IsUndefined() || IsEmpty() )
return;
const CExtBitmap * pBmpBuffer = BitmapGetBuffer();
if( pBmpBuffer == NULL || pBmpBuffer->IsEmpty() )
return;
if( ( dwHelperPaintFlags & __EGCPF_SIMPLIFIED_RENDERING_TARGET ) != 0 )
{
CRect rcX( rcCellExtra );
CExtMemoryDC dcX( &dc, &rcX );
OnPaintText( rcCellText, wndGrid, dcX, nVisibleColNo, nVisibleRowNo, nColNo, nRowNo, nColType, nRowType, rcCellExtra, rcCell, rcVisibleRange, dwAreaFlags, dwHelperPaintFlags&(~__EGCPF_SIMPLIFIED_RENDERING_TARGET) );
return;
}
bool bSmootherAsPossible = true;
if( m_eImageMode == eStretch )
{
CRect rcStretch = rcCellText;
rcStretch.InflateRect( 2, 0 );
pBmpBuffer->AlphaBlendSkinParts( dc.GetSafeHdc(), rcStretch, CRect(0,0,0,0), CExtBitmap::__EDM_STRETCH, true, bSmootherAsPossible );
}
else if( m_eImageMode == eTile )
pBmpBuffer->AlphaBlendSkinParts( dc.GetSafeHdc(), rcCellText, CRect(0,0,0,0), CExtBitmap::__EDM_TILE, true, bSmootherAsPossible );
else if( m_eImageMode == eAlign )
{
CSize szSize = pBmpBuffer->GetSize();
CRect rcDst( rcCellText.left, rcCellText.top, rcCellText.left + szSize.cx, rcCellText.top + szSize.cy );
DWORD dwCellStyle = GetStyle();
switch( (dwCellStyle&__EGCS_TA_HORZ_MASK) )
{
case __EGCS_TA_HORZ_BY_TYPE:
case __EGCS_TA_HORZ_LEFT:
break;
case __EGCS_TA_HORZ_RIGHT:
rcDst.OffsetRect( rcCellText.right - rcDst.right, 0 );
break;
case __EGCS_TA_HORZ_CENTER:
rcDst.OffsetRect( ( (rcCellText.right - rcCellText.left) - (rcDst.right - rcDst.left) ) / 2, 0 );
break;
#ifdef _DEBUG
default:
ASSERT( FALSE );
break;
#endif // _DEBUG
}
switch( (dwCellStyle&__EGCS_TA_VERT_MASK) )
{
case __EGCS_TA_VERT_BY_TYPE:
case __EGCS_TA_VERT_TOP:
break;
case __EGCS_TA_VERT_BOTTOM:
rcDst.OffsetRect( 0, rcCellText.bottom - rcDst.bottom );
break;
case __EGCS_TA_VERT_MIDDLE:
rcDst.OffsetRect( 0, ( (rcCellText.bottom - rcCellText.top) - (rcDst.bottom - rcDst.top) ) / 2 );
break;
#ifdef _DEBUG
default:
ASSERT( FALSE );
break;
#endif // _DEBUG
}
CRect rcSrc( 0, 0, szSize.cx, szSize.cy );
rcDst.top = max( rcDst.top, rcCellText.top );
rcDst.left = max( rcDst.left, rcCellText.left );
rcDst.bottom = min( rcDst.bottom, rcCellText.bottom );
rcDst.right = min( rcDst.right, rcCellText.right );
if( ::RectVisible( dc.GetSafeHdc(), &rcDst ) )
{
INT nOldStretchBltMode = bSmootherAsPossible ? ( ::GetStretchBltMode( dc.m_hDC ) ) : ( COLORONCOLOR ) ;
if( bSmootherAsPossible )
::SetStretchBltMode( dc.m_hDC, ( g_PaintManager.m_bIsWinNT ) ? HALFTONE : COLORONCOLOR );
pBmpBuffer->AlphaBlend( dc.m_hDC, rcDst, rcSrc );
if( bSmootherAsPossible )
::SetStretchBltMode( dc.m_hDC, nOldStretchBltMode );
}
}
}
|
|
|
L Freddi
|
Jul 20, 2009 - 6:12 PM
|
Hi, supporters I have two page inherited CExResizableDialog. One page have three dialog on CExtControlBar. When I change this page to the other page and return to this page, three dialog’s position is stragne. I search this website, I find the function "RecalcLayout()" But when I slowly change page, it’s positon is ok, but fast change page, it’s positon is still strange. Please give me the solution ASAP. thanks.
|
|
|
Technical Support
|
Jul 21, 2009 - 8:51 AM
|
Could you tell us how to reproduce this issue using any of our sample applications?
|
|
|
L Freddi
|
Jul 21, 2009 - 6:10 PM
|
if (!m_clsAAAWnd.Create(_T("AAA"),
this,
ID_VIEW_PANEL_AAA,
WS_CHILD|WS_VISIBLE | WS_HSCROLL
|CBRS_BOTTOM|CBRS_GRIPPER|CBRS_TOOLTIPS))
{
return FALSE;
} if (!m_clsAAADlg.Create(IDD_DIALOG_AAA, &m_clsAAAWnd))
{
return FALSE;
}
m_clsAAADlg.SetParenthWnd(hWnd); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// BOOL bShow = (m_dwUI & MAIN_UI_AAA) ? TRUE : FALSE;
ShowControlBar( &m_clsAAAWnd, bShow, TRUE ); RecalcLayout(); ============================================================ I have AAA dialog in page. The other page return to this page that has AAA dialog, AAA dialog size is strange. Why size is change despite of using ReclacLayout()?
|
|
|
Technical Support
|
Jul 22, 2009 - 12:42 PM
|
Please ensure you invoke the CExtControlBar::FrameEnableDocking() method. The CControlBar::EnableDocking() methods of all the bars should also be re-dockable in your application.
|
|
|
Eugen Rata
|
Jul 14, 2009 - 2:49 PM
|
Hi
I’m wondering if you’ve got a CellType that would expose its CDC object or maybe an OnPaint event where I can paint myself some GDI objects. If not, what would be the easiest way to paint myself some rectangle and ellipses inside a specified cell?
Thx
|
|
|
Technical Support
|
Jul 16, 2009 - 12:59 PM
|
We created a small test project, which demonstrates how to code a simple custom drawn grid cell.
|
|
|
Eugen Rata
|
Jul 16, 2009 - 5:17 PM
|
Just perfect guys. Thx so much!
|
|
|
Technical Support
|
Jul 15, 2009 - 1:33 PM
|
Any CExtGridCell grid cell consists of the following parts, which are enumerated from left to right looking at layout of any grid cell:
- Icon. Optional part. It’s absent if the CExtGridCell::IconGet() method returns NULL. The CExtGridCell::OnPaintIcon() virtual method draws this part.
- Check box or radio button. Optional part. It’s present if the __EGCS_CHK_CHECK, __EGCS_CHK_RADIO or __EGCS_CHK_INDETERMINATE grid cell styles are applied. The CExtGridCell::OnPaintCheck() virtual method draws this part.
- Text. Always present part of grid cell until the CExtGridCell::TextGet() method returns empty text. The CExtGridCell::OnPaintText() virtual methods draws this part.
- Rest area. Always present part of grid cell until there is a free space between text and cell buttons. The CExtGridCell::OnPaintRestArea() virtual method draws this part.
- Up-down button. Optional part. It’s present if the __EGCS_BUTTON_UPDOWN grid cell style are applied. The CExtGridCell::OnPaintButton() virtual methods draw this part.
- Drop down button. Optional part. It’s present if the __EGCS_BUTTON_DROPDOWN grid cell style are applied. The CExtGridCell::OnPaintButton() virtual method draws this part.
- Ellipsis button. Optional part. It’s present if the __EGCS_BUTTON_ELLIPSIS grid cell style are applied. The CExtGridCell::OnPaintButton() virtual methods draw this part.
This is how you can repaint any part of any grid cell. For example, the CExtGridCellInplaceSlider::OnPaintRestArea virtual method in the CExtGridCellInplaceSlider grid cell draw the slider or scroll bar like looking control on the surface of the grid cell. Another example, the CExtGridCellPictureBase::OnPaintText() virtual method draws image instead of the text part of grid cell in all the picture grid cell classes.
If you don’t need to improve any of existing grid cell classes, then you can re-draw entire grid cell surface. All the grid cells are painted in two steps. The CExtGridCell::OnPaintBackground() virtual method is invoked first and it draws background of the grid cell. This method is responsible for highlighting selected cells. Then the CExtGridCell::OnPaintForeground() virtual method is invoked for painting all the built-in grid cell parts meant above. You can override the CExtGridCell::OnPaintForeground() virtual method for painting anything instead of default looking grid cell. You can use preliminary drawn cell background or over fill it with anything you need. The completely re-painted grid cell may require to implement other features. You may need to implement cell measuring (the CExtGridCell::OnMeasure***() virtual methods) because they needed for best fitting of grid columns/row which is typically performed on double click over column/row header separators. You may need the grid cell serialization and assignment (the CExtGridCell::Serialize() and CExtGridCell::Serialize() virtual methods) if your grid cell should support copying, pasting and drag-n-dropping. You may need comparison (the CExtGridCell::Compare() virtual method) if your grid cell will be used in sort-able and filter-able grid columns and/or rows. You may need to handle mouse and keyboard events (the CExtGridCell::OnClick(), CExtGridCell::OnHover(), CExtGridCell::OnKey() and CExtGridCell::OnSysKey() virtual methods) if your grid cell should support input. So, if you have any details about your task, then we are ready to discuss them.
|
|
|
Eugen Rata
|
Jul 15, 2009 - 2:12 PM
|
Hi
Thx for all this info. That’s of course very nice of you to provide such a detailed help, but being a practical person I was expecting to see a small sample that does what I need. :)
Well anyway, i tried some things, I overrode OnPaintBackground, it works fine, I can paint my rectangle, but the picture is gone when cell is selected. What flags shall I check / use in order to make achieve a correct behavior? Or is better do not touch OnPaintBackground and use OnPaintText instead? Which way would you go?
Thx
|
|
|
Eugen Rata
|
Jul 8, 2009 - 1:36 PM
|
Hi
How to tell Prof UIS library do NOT user current regional settings for layout and currency settings, but instead always use English format?
Thx
|
|
|
Eugen Rata
|
Jul 9, 2009 - 5:04 PM
|
I have such a code in my App::InitInstance() method
if(!g_PaintManager.PaintManagerStateLoad(pApp->m_pszRegistryKey, pApp->m_pszProfileName, pApp->m_pszProfileName)) g_PaintManager.InstallPaintManager(RUNTIME_CLASS(CExtPaintManagerOffice2007_R2_LunaBlue)); g_ResourceManager->AllowCustomLang(true); g_ResourceManager->SetLangIdDesired(__EXT_MFC_LANG_ID_ENGLISH_US);
MainDlg dlg; m_pMainWnd = &dlg; INT_PTR nResponse = dlg.DoModal();
The program crashes at DoModal() call. If I comment the 2 lines you told me, than everything works fine. Do I need something else to do in the project?
Thx
P.S. Using Prof UIS 2.8.2, under VS 2008 with Win 7 x64 RC. Program compiled as x86.
|
|
|
Technical Support
|
Jul 10, 2009 - 1:58 PM
|
Please check the language of your dialog template resource used by the MainDlg class. It should be English US. Otherwise Prof-UIS will not be able to load it.
|
|
|
Technical Support
|
Jul 9, 2009 - 12:11 PM
|
You should invoke the following code before creating any Prof-UIS controls: g_ResourceManager->AllowCustomLang( true );
g_ResourceManager->SetLangIdDesired( __EXT_MFC_LANG_ID_ENGLISH_US );
|
|
|
Nam Huy
|
Jul 8, 2009 - 7:20 AM
|
I was wondering if animated can be shown in a grid? I am evaulating if it is possible is to display a symbol that behaves like it is flashing Can you give some guidelines to emulate this? Thanks
|
|
|
Technical Support
|
Jul 8, 2009 - 10:34 AM
|
Unfortunately we have no GIF animation grid cell in Prof-UIS. No grid cell uses any timer based animations. The grid cells can change their look only while handling mouse or keyboard input. But the grid control displayed on the Grid dialog page in the ProfUIS_Controls sample application shows an animated progress bar. The CPageGrid dialog page is running a timer which changes grid cells and repaints them (CPageGrid::OnTimer()). You should do the same if you need to implement some animation. But you also need to create a new grid cell class which supports animated content painting. Please provide us with more details about where the animation should appear and we will help you to code it. Do you want to make the build-in cell icon animated or entire grid cells should work like video player?
|
|
|
Hyeon Soo Ryu
|
Jul 8, 2009 - 5:31 AM
|
Now I attached the CExtToolControlBar on the Top of the CExtResizableDialog if(!m_wndEmapToolBar.LoadToolBar(IDR_EMAP_TOOLBAR))
{
DWORD dwerr2 = GetLastError();
TRACE0("Failed to create toolbar\n");
return FALSE; // fail to create
} And Set Toolbar Style......( resource style value is 0x50402034 ) m_wndEmapToolBar.SetBarStyle( m_wndEmapToolBar.GetBarStyle() & ~CBRS_GRIPPER ); And I want to remove the Toolbar option tag ( at right end of the toolbar , small triangle ) that I can’t push now. So I want to remove the mark (small triangle) What Style value ( Style Option ) can I select ???? Thanks. ˆˆ
|
|
|
Technical Support
|
Jul 8, 2009 - 10:32 AM
|
To remove the chevron button from a toolbar, you should use a toolbar class like this: class CYourToolbar : public CExtToolControlBar
{
public:
virtual CExtBarContentExpandButton * OnCreateBarRightBtn()
{
ASSERT_VALID( this );
return NULL;
}
};
|
|
|
Hyeon Soo Ryu
|
Jun 27, 2009 - 1:33 AM
|
CExtToolControlBar m_wndToolBar; ---------- DDX_Control(pDX, IDC_EMAP_TOOLBAR, m_wndToolBar); ------- if(!m_wndToolBar.Create(NULL,this, AFX_IDW_TOOLBAR) || !m_wndToolBar.LoadToolBar(IDR_TOOLBAR1))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
m_wndToolBar.ShowWindow(TRUE);
m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_GRIPPER);
m_wndToolBar.m_bForceBalloonGradientInDialogs = TRUE; m_wndToolBar.SetWindowPos(
NULL, 0, 0, 0, 0,
SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOOWNERZORDER
|SWP_FRAMECHANGED
); ----------- BUT , executing LoadToolBar(IDR_TOOLBAR1)........... happens to the following Error. Unhandled exception at 0x7c93120e ................ What is the problem? Thanks.
|
|
|
Technical Support
|
Jun 27, 2009 - 1:39 PM
|
If you dropped toolbar as a custom control into your dialog template resource, then you should not invoke its Create() method. You also don’t need to invoke toolbar’s SetWindowPos() method. You should only invoke the dialog’s RepositionBars() method from dialog’s OnInitDialog(<code> and <code>OnSize()<code> methods. Please take a look at the ProfUIS_Controls sample application. The Menubar and Toolbars dialog page contains several toolbars and menu bar. All these bars are dropped into dialog form as custom dialog controls. The <code>CPageBase::OnInitDialog() method in this sample application includes several DDX entries for all the bars. The CPageBase::DoDataExchange() method just initialized toolbar but does not create them. The toolbar windows are created during dialog loading and then subclassed by DDX entries. The CPageBase::DoDataExchange() method finally invokes the CWnd::RepositionBars(0,0xFFFF,0); code which places all the bars near dialog borders. This code is also invoked from the CPageBase::OnSize() method and that’s why toolbars are always placed near dialog borders when dialog is resized.
|
|
|
Hyeon Soo Ryu
|
Jun 25, 2009 - 2:22 AM
|
MainFrm calls the Modal dialog ( using the CExtResizableDialog ) and. In CExtResizableDialog , Create the MenuBar ( using CExtMenuControlBar) and append the menubar BUT, the menubar is attached to MainFrm and CExtResizableDialog too ˆˆ;;; What is the Problem? Help me please.....Thanks.
|
|
|
Technical Support
|
Jun 28, 2009 - 10:45 AM
|
There is an important limitation related to the CExtMenuControlBar class: each menu bar window must be the only one menu bar in scope of one command profile of the Prof-UIS command manager.
The main frame window in your application initializes some named command profile and creates the menu bar. The dialog window. which also has its own menu bar, should initialize its own command profile with unique name. You should invoke the CExtCmdManager::ProfileSetup() method in dialog’s OnInitDialog() virtual method and the CExtCmdManager::ProfileDestroy() method in dialog’s OnOK() and OnCancel() virtual methods.
|
|
|
Andrej Kasa
|
Jun 24, 2009 - 6:38 AM
|
Hello, this is only a minor issue, so nothing critical, however, if possible I would like to overcome it somehow since it does not look good. After upgrade to 2.85 from 2.84 without changing anything in my code there is a small (1-2 seconds) delay when my mainframe window appears - mouse icon changes to hourglass for that period and application is frozen for that period. This only happens on WinXP since on Vista aero takes care of displaying non client regions and this seems to be a problem with non client areas. Do you know about this issue? Is it possible to solve it somehow? In 2.84 this never happened. To see this behaviour in action please download my demo app that demonstrates this: files.rfmeasure.com/RFMeasureBetaDemo.exe thanks, krompo
|
|
|
L Freddi
|
Jun 24, 2009 - 1:51 AM
|
Hi, supporters I want to add icon beside menu string in CExtPopupMenuWnd. Please give me function name, using sample. thanks.
|
|
|
Technical Support
|
Jun 24, 2009 - 12:54 PM
|
By default popup menu items are using the command descriptions stored in the command manager. So, you should update the command descriptions in the command manager with icons. You can use the g_CmdManager->UpdateFromToolBar() code (the CExtCmdManager::UpdateFromToolBar() method) for loading icons for all the required menu commands from the toolbar resource. This toolbar resource may be created for command manager only. It’s not necessary to use it with toolbar control. You can use the CExtCmdManager::CmdSetIcon() method for assigning/changing/removing icon of individual commands registered in the command manager.
If your popup menus uses menu command items which are not based on the command manager, then you should use the CExtPopupMenuWnd::ItemSetPopupIcon() method for assigning an icon to menu item.
The CExtPopupMenuWnd::ItemInsert() method inserts menu items which are based on the command manager. The CExtPopupMenuWnd::ItemInsertCommand() method inserts menu items which are not based on the command manager. By default the CExtPopupMenuWnd::LoadMenu() and CExtPopupMenuWnd::UpdateFromMenu() methods are initializing popup menu with menu command items which are based on the command manager because the bNoRefToCmdMngr parameter of these methods has the false flag as default parameter value.
|
|
|
L Freddi
|
Jun 25, 2009 - 12:09 AM
|
thanks to your fast reply. and I have three guestion. As follow your direction, I made popup menu but had three problem. ================================================================
CExtPopupMenuWnd * pPopup = new CExtPopupMenuWnd;
pPopup->UpdateFromMenu(GetSafeHwnd(), &menu, true, true, true); CExtBitmap _bmp;
VERIFY(_bmp.LoadBMP_Resource( MAKEINTRESOURCE(IDB_BITMAP_VIEW)));
static const COLORREF clrTransparentPaint = RGB(255,0,255);
static const CSize _sizeBitmapPartPaint(16,16); CPoint ptBitmapOffset(0, 0);
CRect rcBitmapPart(ptBitmapOffset, _sizeBitmapPartPaint);
CExtCmdIcon _icon;
_icon.m_bmpNormal.FromBitmap(_bmp, &rcBitmapPart);
ASSERT( ! _icon.IsEmpty() );
_icon.m_bmpNormal.AlphaColor( clrTransparentPaint, RGB(0,0,0), 0 );
pPopup->ItemSetPopupIcon(nPos, _icon); ==================================================================== 1. Menu’s status don’t change. ex) pCmdUI->Enable(FALSE); Menu don’t change to disable status. I searched this board for answer, pPopup->UpdateFromMenu(GetSafeHwnd(), &menu, true, true, true); true->false. But, if bNoRefToCmdMngr is false, ItemSetPopupIcon function don’t work. 2. I don’t know menu’s check status. ex) pCmdUI->SetCheck(TRUE); 3.Because icon replace on check , I want to know check status as differenct icon type. as below source, Can CExtBitmap use CDib class? =====================================================
DWORD tagImageMap[IB_NUMBER_OF_IMAGES] = {1,0,3,2,0}; IB_MAP_OF_IMAGES tagIbMap;
CDib clsDib;
clsDib.ReadFromFile(ICON_IMAGE);
for (int i = 0; i < IB_NUMBER_OF_IMAGES; i++)
{
tagIbMap.adwImageOrder[i] = tagImageMap[i];
}
============================================================
|
|
|
Technical Support
|
Jun 28, 2009 - 10:44 AM
|
Frist of all, if the IDB_BITMAP_VIEW bitmap is not a 32-bit one, then you should invoke the CExtBitmap::Make32() method before invoking the CExtBitmap::AlphaColor() method.
Second, the CCmdUI::Enable() method is not invoked because entire command updating method is not invoked. The CExtPopupMenuWnd::UpdateFromMenu() method in your code snippet initializes popup menu with command items which are not based on the command manager. These command items are also not updated via MFC’s command updating mechanism. You absolutely correctly changed the bNoRefToCmdMngr parameter to false. Now your popup menu is based on the command manager. You should update the command manager from the menu resource at your application startup. Then you should update the command manager with icons like we described in our previous answer in this forum thread.
Third, the MFC’s command updating mechanism allows you to change the checked status of menu items and toolbar buttons but not to get the current checked status. The current checked status of any particular command should be kept in your application internally.
Fourth, we have no idea what is CDib class? May be it’s described here:
http://www.jomier.com/julien/projects/wst/Documentation/html/classCDIB.html
If this description is what is CDib class in your question, then you can get CBitmap from CDib and then invoke the CExtBitmap::FromBitmap() method.
|
|
|
matt brown
|
Jun 18, 2009 - 1:01 PM
|
Hi, I just added included Prof-UIS.h and now getting the above mentioned error message. Is CCommand a class used in Prof-uis? Thanks
|
|
|
matt brown
|
Jun 20, 2009 - 6:42 AM
|
Still getting: error C2872: ’CCommand’ : ambiguous symbol I tried another approach. I added a CCommand class to one of your sample projects class CCommand
{
public:
CCommand() {}
~CCommand() {}
};
static bool g_bSplashWndClassRegistered = false;
CSplashWnd::CSplashWnd(
CWnd * pWndParent,
UINT nBitmapID
)
: m_nMaxTextLines( -1 )
, m_nLineHeight( -1 )
, m_clrText( RGB(255,255,255) )
, m_rcText( 0, 0, 0, 0 )
{
CCommand c;
VERIFY( RegisterSplashWndClass() );
VERIFY( Create( pWndParent, nBitmapID ) );
} Got the error message: --------------------Configuration: ProfUIS_Controls - Win32 Unicode Debug--------------------
Compiling...
MainDlg.cpp
C:\Program Files\FOSS Software Inc\Prof-UIS trial\Samples\ProfUIS_Controls\MainDlg.cpp(47) : error C2872: ’CCommand’ : ambiguous symbol
Error executing cl.exe.
ProfUIS_Controls-ud.exe - 1 error(s), 0 warning(s) I’m using VC++ 6 / SP6
|
|
|
Technical Support
|
Jun 21, 2009 - 12:34 PM
|
The CCommand class is present in the OLE DB template library:
http://msdn.microsoft.com/en-us/library/yfte190h(VS.80).aspx
Prof-UIS has no classes with such name. If you are using Visual C++ 6.0 and some newer Platform SDK is installed, then the OLE DB templates are available and can be included into your project via other ATL/MFC header files.
In any case, only Microsoft allows itself to call classes using such simple names like CCommand. You should use something like CMyCommand.
|
|
|
matt brown
|
Jun 19, 2009 - 2:11 PM
|
OK, I’ll try that - thanks for info
|
|
|
Technical Support
|
Jun 19, 2009 - 2:10 PM
|
No, there is no such class in Prof-UIS. Besides, we have just compiled Prof-UIS with all the Visual C++ versions starting from 6.0 and up to 2010 and we have not encountered this conflict. Please check the include folders list in your Visual Studio settings. The standard includes must be at the top. Any newer Platform SDK and/or DirectX SDK must be at the bottom.
|
|
|
Bart Kampers
|
Jun 17, 2009 - 8:51 AM
|
The file ProfSkin\ExtSkinItem.h includes the line " #import <msxml.dll> ". It seems that Window Vista does not provide this dll. I replaced the line by " #import <msxml.tlb> " and it seems to work, also in XP.
But I am not sure if this is the correct way to solve the problem.
|
|
|
Technical Support
|
Jun 17, 2009 - 9:19 AM
|
Yes, you are right. Vista has msxml6.dll. But if you want to create an application running on Windows versions older than Vista, then you should use the msxml.dll. You can get it from Windows XP and put into the .../Prof-UIS/Bin_*** folder. This is enough for successful compilation of any 32 or 64 bit project.
|
|
|
Zoltan Bokor
|
Jun 17, 2009 - 2:45 AM
|
I am using Prof-UIS 2.85 with a MDI application. Running my application on Windows 7 Ultimate Build 7100 (Beta) and using any of the Office 2007 themes from Prof-UIS there is a 2 time flickering (client area repaints 2 times) on the CExtNCW < CMDIChildWnd > window every time before I open and after I close a modal CExtNCW < CExtResizableDialog>. Using a non Office 2007 Prof-UIS theme there is no flickering.
|
|
|
Zoltan Bokor
|
Jul 6, 2009 - 11:29 PM
|
You sholud try at Nvidia GeForce8200M G on Windows 7 (7100) 64bit (x64). The Windows 7 Software Logo testing software also works on Windows 7 x64 and my test PC is a laptop.
|
|
|
Zoltan Bokor
|
Jul 6, 2009 - 12:04 AM
|
I had updated the video drivers to the Windows 7 (x64) WHQL Nvidia drivers but the flickering is still there with the Office 2007 themes. I also tested my applications trough Windows 7 software Logo Test program and there were problems with Restart Manager tests when I used the Office 2007 themes ( the application doesn’t shuts down on WM_QUERYENDSESSION / WM_ENDSESSION messages and doesn’t responds in the time out period). So there is something wrong with Office 2007 themes under Windows 7 (x64).
|
|
|
Technical Support
|
Jul 6, 2009 - 1:24 PM
|
Prof-UIS does not handle WM_QUERYENDSESSION and WM_ENDSESSION messages. They are delivered to the default window procedures as is. Prof-UIS library cannot respond to the WM_QUERYENDSESSION message because we cannot decide whether your application should create a shutdown blocking reason or whether it should register itself for restart.
We downloaded the following software:
https://connect.microsoft.com/Downloads/Downloads.aspx?SiteID=831
But we cannot install it. It displays the This installation package is not supported by this processor type message.
We will try to install Windows 7 to computer with NVidia card and test our samples. Currently we tested on ATI card only. Please let us know which NVidia card model is on your Windows 7 PC?
|
|
|
Zoltan Bokor
|
Jun 30, 2009 - 7:01 AM
|
It could be because of the prerelease Windws 7 driver (Nvidia GeForce8200M G (Prerelease - WDDM 1.1)) ? Can you give me an FTP adress to send you a sample "flickering" application ?
|
|
|
Technical Support
|
Jun 30, 2009 - 1:58 PM
|
Yes. We even saw incorrectly drawn menu shadows before reinstalling NVidia drivers. We do not have any special test application. We used Prof-UIS samples based on MDI interface and About dialog box which is always displayed as modal. We tested both 2.85 and latest 2.87. Last one has improved CExtNCW class and demonstrates flicker rarely than 2.85. Please drop us an e-mail and we will provide you with the latest Prof-UIS source code download.
|
|
|
Technical Support
|
Jun 24, 2009 - 12:45 PM
|
We are sorry for the delay with this replied. We just installed a new copy of Windows 7 build 7100 on a new computer and checked again all the Prof-UIS 2.85 samples. We noticed a single flicker effect on the windows created inside MDI child frames. But it occurs only when closing the modal about dialog and only in windows without buffered painting such as edit controls in the MDI_DynamicBars sample application. We never saw double flicker effects. The single flicker effect is the normal painting effect of edit common control and other windows based on non-buffered painting.
|
|
|
Zoltan Bokor
|
Jun 18, 2009 - 11:22 PM
|
System configuration: - Windows 7 build 7100 - Nvidia GeForce8200M G (Prerelease - WDDM 1.1) - Aero Theme - Visual Studio 7.1.6030 (Service Pack 1) - Prof-UIS 2.85 MBCS Dll (ProfUIS285m.dll) - and the flickering only occurs on the 4 Office 2007 Prof-UIS themes
|
|
|
Technical Support
|
Jun 18, 2009 - 1:29 PM
|
We tried to reproduce this flickering effect but failed. The Windows 7 (7100) tests are equal to Vista and XP tests in our case. Most of the sample applications have modal about box based on a resizable dialog. But we didn’t notice any flickering. Please let us know additional details. Do you use Vista like desktop settings on your Windows 7? I.e. whether DWM/glass is enabled? Which version of Visual Studio you are using?
|
|
|
L Freddi
|
Jun 16, 2009 - 8:21 PM
|
I have a dialog derived CExtResizableDialog. In a dialog control Tab key don’t work. And user push caps lock key, dilog page disappear. Please help me ASAP.
|
|
|
Technical Support
|
Jun 17, 2009 - 9:14 AM
|
If the tab key does not work in your dialogs, the message pre-translation is broken. If your dialog implements the PreTranslateMessage() virtual method and it does not invoke the parent class method, the dialog has no chance to handle the tab key pressing.
|
|
|
Johannes Schwenk
|
Jun 16, 2009 - 10:49 AM
|
Hallo, 1. I`m trying to AutoResize a Multiline Cell, but nothing happens. I can`t resize the row manually, too. What am I do wrong? 2. Is it possible, to uncheck all other radio buttons in the whole Grid, if one of the radio buttons is checked? MyCode: m_puisgrid.SiwModifyStyle(
(__ESIS_STH_PIXEL|__ESIS_STV_ITEM) // item scroll window styles
| __EGBS_SFB_CELLS // selection/focus type
| __EGBS_RESIZING_CELLS_OUTER // enable row/column resizing
| __EGBS_RESIZING_CELLS_INNER
| __EGBS_DYNAMIC_RESIZING // resize rows/columns on-the-fly
//|__ESIS_DISABLE_AUTOHIDE_SB_H|__ESIS_DISABLE_AUTOHIDE_SB_V
,
0,
false
);
m_puisgrid.BseModifyStyleEx(
__EGBS_BSE_EX_DBLCLK_BEST_FIT_ROW // do best fit sizing on double clicks over column divider
| __EGBS_BSE_EX_DBLCLK_BEST_FIT_COLUMN // do best fit sizing on double clicks over row divider
,
__EGWS_BSE_EX_DEFAULT,
false
);
m_puisgrid.BseModifyStyle(
__EGWS_BSE_SORT_COLUMNS,
0,
false
);
m_puisgrid.SiwModifyStyleEx(
__EGBS_EX_CELL_TOOLTIPS_INNER
| __EGBS_EX_CELL_EXPANDING_INNER
| __EGWS_EX_PM_COLORS
| __EGBS_EX_CORNER_AREAS_3D
,
0,
false
);
m_puisgrid.OuterRowCountTopSet( 1L, false );
m_puisgrid.ColumnAdd( 2L );
m_puisgrid.RowAdd( 2L, false );
CExtGridCellHeader* celltop1 = (CExtGridCellHeader*)m_puisgrid.GridCellGetOuterAtTop( 0L, 0L, RUNTIME_CLASS(CExtGridCellHeader) );
CExtGridCellHeader* celltop2 = (CExtGridCellHeader*)m_puisgrid.GridCellGetOuterAtTop( 1L, 0L, RUNTIME_CLASS(CExtGridCellHeader) );
CExtGridCellString* cell1 = (CExtGridCellString*)m_puisgrid.GridCellGet( 0L, 0L, 0, 0, RUNTIME_CLASS(CExtGridCellString) );
CExtGridCellRadioButton* cell2 = (CExtGridCellRadioButton*)m_puisgrid.GridCellGet( 1L, 1L, 0, 0, RUNTIME_CLASS(CExtGridCellRadioButton) );
CExtGridCellString* cell3 = (CExtGridCellString*)m_puisgrid.GridCellGet( 0L, 1L, 0, 0, RUNTIME_CLASS(CExtGridCellString) );
CExtGridCellRadioButton* cell4 = (CExtGridCellRadioButton*)m_puisgrid.GridCellGet( 1L, 0L, 0, 0, RUNTIME_CLASS(CExtGridCellRadioButton) );
celltop1->TextSet( _T("Header1") );
celltop1->ExtentSet( 150 ); // column width = 150 pixels
celltop2->TextSet( _T("Header2") );
celltop2->ExtentSet( 250 ); // column width = 250 pixels
cell1->TextSet("AZeile1\r\nAZeile2\r\nZeile3");
cell1->ModifyStyleEx( __EGCS_EX_WRAP_TEXT );
cell3->TextSet("AZeile1\r\nAZeile2\r\nZeile3");
cell3->ModifyStyleEx( __EGCS_EX_WRAP_TEXT );
m_puisgrid.BestFitRow( 0L );
m_puisgrid.BestFitRow( 1L );
m_puisgrid.OnSwUpdateScrollBars();
m_puisgrid.OnSwDoRedraw(); I used the DemoProject from my last Thread. You can download the whole solution here.
|
|
|
Johannes Schwenk
|
Jun 16, 2009 - 10:51 AM
|
What i forgot to say: I`m trying to resize the multiline cell in height with the BestFitRow() function.
|
|
|
Technical Support
|
Jun 16, 2009 - 12:45 PM
|
The CExtGridWnd control uses outer header grid cells in outer header rows to store information about the column width. By default, it tries to find header cells at top, then at bottom and uses the CExtGridCell::Extent***() methods for operating with column width. If the grid control does not have header cells at top/bottom, then it’s not possible to specify variable column widths and all the column widths are equal to the value in pixels returned by the CExtGridWnd::DefaultColumnWidthGet() method. Some people need to see grid columns with variable sizes but does not need outer header rows at top/bottom. It’s possible to make outer header rows having zero pixel height using the CExtGridWnd::OuterRowHeightSet() method.
The same mechanism is applied to grid rows. The grid control looks for the header rows at left, then at right. The similar CExtGridWnd::DefaultRowHeightGet() and CExtGridWnd::OuterColumnWidthSet() methods are provided. The CExtGridCell::Extent***() methods invoked for the header cells in outer header column are operating with the row heights.
Your grid does not have the outer header columns. There is no place to save information about measured row height. The CExtGridWnd::BestFitRow() method does not know where to save measured result. If you run the new version of your test project, then you can start the grid row resizing but the rows does not become resized.
We modified the last version of your test project:
http://www.prof-uis.com/download/forums/tmp/FIXED-STEP-2-ProfUisGridDemoProject.zip
Please search for the PROF-UIS TECH SUPPORT text in comments.
|
|
|
Dirk lindner
|
Jun 15, 2009 - 6:31 AM
|
Hello, i have 2 MenuBars in one application. One In the Mainframe and one in a dialog. If i open the dialog the text from the dialog menu will be used for both MenuBars

Here is the sourcecode for the Menu classes.
//Mainframe MenuBar
#pragma once #include "stdafx.h" #include <Prof-UIS.h> #include <ExtToolControlBar.h>
class CPrfMenuBar : public CExtMenuControlBar { public: bool RegisterToolBar( __EXT_MFC_SAFE_LPCTSTR lpszWindowName, CWnd* p_pParentWnd, UINT p_nIDR_ID ) {
if( !Create( lpszWindowName, p_pParentWnd, p_nIDR_ID ) ) { ASSERT( FALSE ); }
return true; }
protected:
BOOL _UpdateMenuBar(BOOL bDoRecalcLayout/* = TRUE */){ CMenu * pMenu = GetMenu(); UINT nItem = pMenu->GetMenuItemCount();
for (UINT i = 0; i < nItem; i++){ CString sString; pMenu->GetMenuString(i, sString, MF_BYPOSITION);
/* if( sString.Left(4).CompareNoCase(_T("@STR")) == 0 ){ long nStringID = atol( sString.Mid(4) ); if( nStringID ) sString = g_oStrMngr.GetString( nStringID ); }*/ pMenu->ModifyMenu(i, MF_BYPOSITION, pMenu->GetMenuItemID(i) ,sString) ; } return CExtMenuControlBar::_UpdateMenuBar( bDoRecalcLayout); }
};
And for the Dialog #ifndef __EXTMINIDOCKFRAMEWND_H #include <../Src/ExtMiniDockFrameWnd.h> #include <ExtMenuControlBar.h> #endif #pragma once
class CPrfObjListMenuBar : public CExtMenuControlBar { public: bool RegisterToolBar( __EXT_MFC_SAFE_LPCTSTR lpszWindowName, CWnd* p_pParentWnd, UINT p_nIDR_ID ) { g_CmdManager->ProfileSetup(PROFUIS_PROFILENAME, p_pParentWnd->GetSafeHwnd() ); LoadMenuBar( p_nIDR_ID ); return true; } protected: virtual BOOL _UpdateMenuBar( BOOL bDoRecalcLayout = TRUE ){ CMenu * pMenu = GetMenu(); UINT nItem = pMenu->GetMenuItemCount(); for (UINT i = 0; i < nItem; i++) { CString sString; pMenu->GetMenuString(i, sString, MF_BYPOSITION); //Translate it /* if( sString.Left(4).CompareNoCase(_T("@STR")) == 0 ){
long nStringID = atol( sString.Mid(4) ); if( nStringID ) sString = g_oStrMngr.GetString( nStringID ); }*/ pMenu->ModifyMenu(i, MF_BYPOSITION, pMenu->GetMenuItemID(i) ,sString) ; }
return CExtMenuControlBar::_UpdateMenuBar( bDoRecalcLayout); } /*!\fn OnCreateBarRightBtn versteckt den rechten BarButton*/ virtual CExtBarContentExpandButton * OnCreateBarRightBtn(){return NULL; } };
Any Idea ?
|
|
|
Dirk lindner
|
Jun 18, 2009 - 4:50 AM
|
Thank, this works fine !
Dirk Lindner
|
|
|
Technical Support
|
Jun 15, 2009 - 12:48 PM
|
There is one very important limitation related to the CExtMenuControlBar window: each menu bar must be the only one menu bar in scope of the Prof-UIS command manager’s command profile. This means your dialog should initialize a unique command profile for itself and for all its child windows including the menu bar. You can invoke g_CmdManager->ProfileSetup( _T("profile-name-for-dialog"), hWndOfDialog ) in the dialog’s OnInitDialog() virtual method and the g_CmdManager->ProfileDestroy( _T("profile-name-for-dialog") ) code in the dialogs OnOK() and OnCancel() methods.
|
|