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 |
|
Thierry Boone
|
May 21, 2007 - 7:44 AM
|
I just installed the 2.7 release of ProfUI. I have 2 CExtControlBar that are docked and in autohide. The name of the second CExtControlBar is badly displayed on the screen, it overlaps the other one or goes out of its tabs
|
|
Technical Support
|
May 21, 2007 - 9:30 AM
|
Would you provide additional details about the problem?
1) Can this problem be reproduced with our samples? 2) Which paint manager should be used? 3) Which Windows version you are using? Do we need to set some specific desktop DPI settings?
|
|
Thierry Boone
|
May 21, 2007 - 10:19 AM
|
I reproduced this with SDI_DynamicBar.
1) Dock the SimpleBar at the same location with a DynamicBar so that they are tabbed together (left or right side) and set it to autohide. -> the issue may be linked to the fact that there is no icon associated with the SimpleBar as in my project.
2) on your sample this happens with Native Windows XP theme, Office2003 with / without color theme.
3) Win version is XP SP2
|
|
Technical Support
|
May 21, 2007 - 12:19 PM
|
This occurs only when the grouped tabs are using the Visual Studio .NET layout (not Visual Studio 2005 layout) and there is no icon assigned to the resizable control bar’s activation command. We agree the text should not be painted at all in this case, but we have no idea about what should be displayed instead of the icon? We think this issue should be fixed locally in the sample applications and in your project(s). I.e. an icon should be assigned to the control bar’s command.
|
|
Thierry Boone
|
May 22, 2007 - 1:56 AM
|
I understand there is no plan to fix. But have a look at the behaviour of the grouped tabs when docked on top or on bottom. It displays the text, which is the right behaviour.
|
|
Technical Support
|
May 22, 2007 - 9:45 AM
|
The horizontal text is drawn with DrawText() API which allows you to draw the ellipsis effect. Unfortunately this API does not allow you to draw it in the vertical direction. So the vertical text is drawn using ExtTextOut() API. We think the auto hide tabs are drawn incorrectly in both cases if the icon is not specified. The better solution is to invoke the following code at startup before any resizable control bars is created: CExtControlBar::g_eAutoHideTabsType = CExtControlBar::__AUTOHIDE_TABS_TYPE_STUDIO_2005; This will allow you to use resizable control bar commands without icon assigned to the resizable control bar activation command.
|
|
Neville Franks
|
May 21, 2007 - 1:38 AM
|
What is the correct method to handle a date selection using CExtPopupDatePickerMenuWnd? I can’t find anything on this class in the Help and the samples show instantiating it, but not interacting with it.
Do I derive a new class from CExtPopupDatePickerMenuWnd, overide _OnMouseClick() and then use the m_pExternalSelectionInfo atribute?
I want to know that user has clicked on a date and then get that date.
Thanks, Nevillle
|
|
Technical Support
|
May 21, 2007 - 10:24 AM
|
It depends on you are using the CExtPopupDatePickerMenuWnd . If it is a CExtBarDateFieldButton toolbar button or menu item, you can override the CExtCustomizeSite::OnPopupDatePickerSelChange() virtual method in your CMainFrame class. If you are using CExtPopupDatePickerMenuWnd directly as a menu item, you can do this by handling the CExtDatePickerWnd::g_nMsgSelectionNotification notification. So to provide you with a more detailed answer, we need more details about in which way you are using CExtPopupDatePickerMenuWnd .
|
|
Neville Franks
|
May 21, 2007 - 4:45 PM
|
I found the sample code that uses the CExtDatePickerWnd::g_nMsgSelectionNotification and have it all working now.
Thanks for your help, Neville
|
|
Neville Franks
|
May 21, 2007 - 3:00 PM
|
Thanks for the reply. I am using it from a menu item.
Neville.
|
|
Neville Franks
|
May 21, 2007 - 6:05 AM
|
I’ve noticed there is a: CExtPopupInplaceDatePicker::pCbDatePickerSelection m_pCbDatePickerSelection; function pointer in CExtPopupDatePickerMenuWnd. Is this what’s used to get date picker notifications? If so can you provide a code example.
Thanks, Neville
|
|
Offer Har
|
May 19, 2007 - 5:51 AM
|
Dear Support,
I have upgraded from 2.62 to 2.70 I have an application using CExtPaintManagerOffice2007_Silver , and in it there is a CExtGridWnd with cells types of CExtGridCellString . In version 2.62 all was fine. In version 2.70 the all the cells color is light gray, and because it’s on white, the text is unreadable.
Please verify and rectify... Thanks, Ron.
|
|
Offer Har
|
May 19, 2007 - 5:58 AM
|
Dear Support,
I found out that this behavior only happens if you attach the read only attribute to the cell. I think that this is a mistake, even if it was intentionally, you cannot read the content of the cell, and I think you should not touch the color of the cell even if it is read-only.
Regards, Ron.
|
|
Technical Support
|
May 21, 2007 - 9:08 AM
|
Thank you for reporting the problem. Here is how you can fix this.
1) Find the following code at the end of CExtGridCell::OnQueryTextColor()
if( clrText == COLORREF(-1L) )
{
if( ( GetStyle() & __EGCS_READ_ONLY ) != 0 )
{
clrText = wndGrid.OnSiwGetSysColor( COLOR_3DFACE );
return clrText;
} // if( ( GetStyle() & __EGCS_READ_ONLY ) != 0 )
} // if( clrText == COLORREF(-1L) ) 2) Replace it with the code below if( clrText == COLORREF(-1L) )
{
if( ( GetStyle() & __EGCS_READ_ONLY ) != 0 )
{
clrText = wndGrid.OnSiwGetReadOnlyTextColor();
return clrText;
} // if( ( GetStyle() & __EGCS_READ_ONLY ) != 0 )
} // if( clrText == COLORREF(-1L) ) 3) Add a new OnSiwGetReadOnlyTextColor() virtual method to the CExtScrollItemWnd and CExtPropertyGridWnd classes: COLORREF CExtScrollItemWnd::OnSiwGetReadOnlyTextColor() const
{
ASSERT_VALID( this );
return OnSiwGetSysColor( COLOR_BTNTEXT );
}
COLORREF CExtPropertyGridWnd::OnSiwGetReadOnlyTextColor() const
{
ASSERT_VALID( this );
return OnSiwGetSysColor( COLOR_3DFACE );
}
|
|
tera t
|
May 18, 2007 - 2:08 AM
|
Hi
An error to compile in Samples_ReportGrid.
VC++6.0 SP6 (Japanese) X:\Prof-UIS\Samples\ReportGrid\ChildView.cpp(295) : error C2002 Usage of the wide character fixed number is not right.
An answer does not hurry.
|
|
Chris Anderson
|
May 17, 2007 - 7:12 PM
|
How can I extend the icon editor sample to handle saving the changes done to the icons/bitmaps displayed in the icon editor dialog?
|
|
Chris Anderson
|
May 21, 2007 - 9:49 AM
|
The first approach didnt make any difference and the second option is not really an option for us since we do not have control over the images that will be edited using the icon editor dialog. Also what would be the approach when saving .ico files?
|
|
Technical Support
|
May 21, 2007 - 12:27 PM
|
The .ICO file format contains several bitmaps and Windows uses automatically one of them which is closest to the currently set display mode. But the modern .ICO format of Windows XP uses 32-bit .PNG images with alpha channel. All the modern Microsoft applications are using customizable UI where you can edit toolbar/menu icons and only one bitmap image is available when you editing icon. We are using CExtBitmap images in Prof-UIS (the CExtCmdIcon class is also based on CExtBitmap) and never HICON handles. So, there are no APIs for saving ICO format available in Prof-UIS. We recommend you switch to using 32-bit images with alpha channel. You can use either the BMP or PNG format.
|
|
Chris Anderson
|
May 18, 2007 - 2:56 PM
|
I sent the source and destination bitmaps via email with some additional questions.
|
|
Technical Support
|
May 21, 2007 - 8:48 AM
|
The initial bitmap is 4 bits per pixel (16 colors). The final bitmap is 32 bits per-pixel (16 million colors). We think the problem may be caused by loading the initial bitmap. You can solve this problem in one of two ways:
1) Use true in the bMake32 parameter when calling CExtBitmap::LoadBMP_File() . 2) Use the 32 bit per pixel format in the original bitmap.
The second approach should definitively solve the problem.
|
|
Chris Anderson
|
May 18, 2007 - 12:08 PM
|
Yes it is a 32-bit bitmap.
|
|
Technical Support
|
May 18, 2007 - 1:37 PM
|
Could you send us the source and destination bitmaps?
|
|
Chris Anderson
|
May 18, 2007 - 9:19 AM
|
This will handle both icons and bitmaps? What APIs would I use to write this information back. I tried using SaveBMP_File but it seems there is a loss of information from the bitmap. Any suggestions?
|
|
Technical Support
|
May 18, 2007 - 11:20 AM
|
To answer you question, please let us know what bitmaps you are using? 32-bit bitmaps?
|
|
Technical Support
|
May 18, 2007 - 7:00 AM
|
You can achieve this by using a CExtIconEditDlg -derived class in which clicks on the IDOK button are handled in the OnOK() virtual method. The CExtIconEditDlg::m_wndIconEditor property represents the CExtImageEditWnd control which contains the edited image.
|
|
Ian McIntosh
|
May 17, 2007 - 10:04 AM
|
One of our developers has a control derived from a CWnd that is owner draw - via OnPaint. It is placed on a dialog derived from CExtResizableDialog.
There are also some prof-UIS based controls (CExtButtons) on the dialog.
Before the CWnd based control was placed on the dialog, it drew OK. Now it doesn’t - the buttons are not displayed but are drawn if you click where they should be.
Any suggestions?
|
|
Ian McIntosh
|
May 18, 2007 - 2:10 AM
|
Your reply seems to be explaining how to draw a custom background, which is not what I want to do.
Let me try to explain again.
I have a CExtResizableDialog based dialog that has several controls on it, created in the resource view. When the dialog contains only controls that derive from prof-UIS classes (eg, buttons deriving from CExtButton), the dialog draws as expected. When a control that is not prof-UIS based (ie, derives from CWnd) and that is owner draw (overrides the OnPaint), the dialog no longer draws as expected - now the CExtButton derived buttons are not drawn (but are drawn if you click where they should be).
It seems that having a CWnd derived class that overrides OnPaint as a control on a CExtResizableDialog interferes with the drawing of the controls &/or background of the dialog. Is this the case?
Is it valid to have a non prof-UIS control on a CExtResizableDialog derived dialog? If so, is it valid to have which overrides OnPaint?
Is there a prof-UIS class that should be used as the basis of an owner draw control in place of CWnd?
Any helpful advice much appreciated.
|
|
Technical Support
|
May 18, 2007 - 11:31 AM
|
There are no restrcitons on using CWnd based controls with Prof-UIS ones. Moreover many Prof-UIS controls are based on CWnd itself. There is one importing thing that is worth to be mentioned. Your custom controls should paint a valid background which is compatible with the dialog background and current theme. Here is how your OnPaint may look: void CYourWnd::OnPaint()
{
ASSERT_VALID( this );
CPaintDC dcPaint( this );
CRect rcClient;
GetClientRect( &rcClient );
if( rcClient.IsRectEmpty() )
return;
CExtMemoryDC dc(
&dcPaint,
&rcClient
);
CRgn rgnClient;
if( rgnClient.CreateRectRgnIndirect( &rcClient ) )
dc.SelectClipRgn( &rgnClient );
// draw themed background first
bool bTransparent = false;
if( g_PaintManager->GetCb2DbTransparentMode( this ) )
{
CExtPaintManager::stat_ExcludeChildAreas(
dc,
GetSafeHwnd(),
CExtPaintManager::stat_DefExcludeChildAreaCallback
);
if( g_PaintManager->PaintDockerBkgnd( true, dc, this ) )
bTransparent = true;
}
if( ! bTransparent )
dc.FillSolidRect(
&rcClient,
g_PaintManager->GetColor( CExtPaintManager::CLR_3DFACE_OUT, this )
);
//////////////////////////////////////////////////////////////////////
// PLACE CONTROL PAINTING CODE HERE
//////////////////////////////////////////////////////////////////////
if( rgnClient.GetSafeHandle() != NULL )
dc.SelectClipRgn( &rgnClient );
g_PaintManager->OnPaintSessionComplete( this );
}
|
|
Technical Support
|
May 17, 2007 - 12:18 PM
|
The CExtResizableDialog class is based the CExtWS template class. The latter handles WM_PAINT in its CExtWS::WindowProc() method. If you need to implement a custom background over the default themed background of the dialog window, please override the WindowProc() virtual method in your CExtResizableDialog -derived class: LRESULT CYourDialogClass::WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
{
switch( message )
{
case WM_PAINT:
CPaintDC dcPaint( this );
CRect rcClient;
GetClientRect( &rcClient );
CExtMemoryDC dc( &dcPaint, &rcClient );
//
// FIRST STEP: Draw Prof-UIS themed background here
//
COLORREF clrBackground = GetBkColor();
bool bTransparent = false;
if( PmBridge_GetPM()->GetCb2DbTransparentMode(this)
&& ( clrBackground == COLORREF(-1L) )
)
{
CExtPaintManager::stat_ExcludeChildAreas(
dc,
GetSafeHwnd(),
CExtPaintManager::stat_DefExcludeChildAreaCallback
);
if( PmBridge_GetPM()->PaintDockerBkgnd( true, dc, this ) )
bTransparent = true;
}
if( (! bTransparent)
&& clrBackground != COLORREF(-1L)
)
dc.FillSolidRect(
&rcClient,
clrBackground
);
PmBridge_GetPM()->OnPaintSessionComplete( this );
//
// SECOND STEP: Draw your custom things into dc here
//
return 0L;
}
return CExtWA CExtResizableDialog::WindowProc( message, wParam, lParam );
}
|
|
Scott Moore
|
May 17, 2007 - 9:31 AM
|
We are having a problem with CExtGridWnd that is really perplexing. We never had this problem with 2.62 when compiled under VS 2003, but when we upgraded to 2.64 and VS 2005, we occasionally get this problem when double-clicking an item in the grid. I would say it happens about 10% of the time. We double-click the grid (while debugging in VS 2005 SP1) and it gives us this error message:
Unhandled exception at 0x00ce68f1 (ProfUIS264ud.dll) in DemoD.exe: 0xC0000005: Access violation reading location 0x00000000.
The location is exthook.cpp, line 243.
if( ::IsWindow( hWndHooked ) ) { nSinkCount = (int)m_HookSinkArray.GetSize(); for( nSinkIdx = 0; nSinkIdx < nSinkCount; nSinkIdx++ ) { CExtHookSink * pHookSink = m_HookSinkArray[ nSinkIdx ]; // <<== error is right here if( pHookSink == NULL ) continue; pHookSink->OnPostHookWndMsg( lResult, m_hWndHooked, nMessage, wParam, lParam ); } // for( nSinkIdx = 0; nSinkIdx < nSinkCount; nSinkIdx++ ) } // if( ::IsWindow( hWndHooked ) )
nSinkIdx == 0 nSinkCount is garbage (56648900) m_HookSinkArray is basically NULL (m_pData internally is NULL)
The call stack is:
ProfUIS264ud.dll!CExtHookSink::HookChains_t::HookChainsWindowProc(unsigned int nMessage=515, unsigned int & wParam=1, long & lParam=3014806) Line 243 + 0xf bytes C++ ProfUIS264ud.dll!CExtHookSink::HookChains_t::g_HookWndProc(HWND__ * hWnd=0x00050ac0, unsigned int nMessage=515, unsigned int wParam=1, long lParam=3014806) Line 287 + 0x14 bytes C++ user32.dll!7e418734() [Frames below may be incorrect and/or missing, no symbols loaded for user32.dll] user32.dll!7e418816() user32.dll!7e4189cd() user32.dll!7e418a10() mfc80ud.dll!AfxInternalPumpMessage() Line 183 C++ mfc80ud.dll!CWinThread::PumpMessage() Line 896 C++ mfc80ud.dll!CWinThread::Run() Line 625 + 0xd bytes C++ mfc80ud.dll!CWinApp::Run() Line 894 C++ mfc80ud.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x00020b4e, int nCmdShow=1) Line 47 + 0xd bytes C++ DemoD.exe!wWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x00020b4e, int nCmdShow=1) Line 33 C++ DemoD.exe!__tmainCRTStartup() Line 589 + 0x35 bytes C DemoD.exe!wWinMainCRTStartup() Line 414 C
The CExtGridWnd class that we are using is actually a derived class. The real class is this:
class CNwGridWnd : public CExtGridWnd {
protected: DECLARE_MESSAGE_MAP() virtual bool OnGbwAnalyzeCellMouseClickEvent( UINT nChar, UINT nRepCnt, UINT nFlags, CPoint point );
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); };
We don’t do much with the methods except send another windows message to our parent window:
bool CNwGridWnd::OnGbwAnalyzeCellMouseClickEvent( UINT nChar, UINT nRepCnt, UINT nFlags, CPoint point ) { ASSERT_VALID(this);
CExtGridHitTestInfo htInfo(point); HitTest( htInfo, false, true );
if (VK_LBUTTON == nChar && ( !htInfo.IsHoverEmpty() || htInfo.IsValidRect() ) // A valid location in the grid && 0 == htInfo.GetInnerOuterTypeOfColumn() // An inner column cell && 0 == htInfo.GetInnerOuterTypeOfRow()) // An inner row cell
{ if (2 == nRepCnt) { bool ret = CExtGridWnd::OnGbwAnalyzeCellMouseClickEvent( nChar, nRepCnt, nFlags, point); GetOwner()->SendMessage(WM_GRID_DBLCLK, htInfo.m_nColNo, htInfo.m_nRowNo); return ret; } else if (nRepCnt < 2) { bool ret = CExtGridWnd::OnGbwAnalyzeCellMouseClickEvent( nChar, nRepCnt, nFlags, point); GetOwner()->SendMessage(WM_GRID_CLK, htInfo.m_nColNo, htInfo.m_nRowNo); return ret; } }
return CExtGridWnd::OnGbwAnalyzeCellMouseClickEvent( nChar, nRepCnt, nFlags, point); }
void CNwGridWnd::OnLButtonDblClk(UINT nFlags, CPoint point) { CWnd* parentWnd = GetOwner(); CExtGridWnd::OnLButtonDblClk(nFlags, point); parentWnd->SendMessage(WM_GRID_DBLCLK, point.x, point.y); }
So, given all that info, do you have any ideas what the problem might be? Creating a small sample program to demonstrate the problem would be a last resort for us, as it would take some time with no guarantees that the problem could be duplicated.
Thank you for taking the time to look at this.
Scott
|
|
Scott Moore
|
May 17, 2007 - 11:42 AM
|
Well, the windows message I send is sent to the parent CExtResizableDlg, which gets the selection from the grid and acts upon it. You could do the same thing by just handling the message and displaying a MessageBox().
But what would cause m_HookSinkArray to be invalid? That’s the real source of the problem.
|
|
Technical Support
|
May 18, 2007 - 5:07 AM
|
We still failed to reproduce the crash. We used the following method in the CDemoGrid class in the SimpleGrids sample: virtual bool OnGbwAnalyzeCellMouseClickEvent(
UINT nChar,
UINT nRepCnt,
UINT nFlags,
CPoint point
)
{
ASSERT_VALID(this);
CExtGridHitTestInfo htInfo(point);
HitTest( htInfo, false, true );
if (VK_LBUTTON == nChar
&& ( !htInfo.IsHoverEmpty() || htInfo.IsValidRect() ) // A valid location in the grid
&& 0 == htInfo.GetInnerOuterTypeOfColumn() // An inner column cell
&& 0 == htInfo.GetInnerOuterTypeOfRow()) // An inner row cell
{
if (2 == nRepCnt)
{
bool ret = CExtGridWnd::OnGbwAnalyzeCellMouseClickEvent(
nChar, nRepCnt, nFlags, point);
// GetOwner()->SendMessage(WM_GRID_DBLCLK, htInfo.m_nColNo, htInfo.m_nRowNo);
/* point 1 */ AfxMessageBox( _T("1") );
return ret;
}
else if (nRepCnt < 2)
{
bool ret = CExtGridWnd::OnGbwAnalyzeCellMouseClickEvent(
nChar, nRepCnt, nFlags, point);
// GetOwner()->SendMessage(WM_GRID_CLK, htInfo.m_nColNo, htInfo.m_nRowNo);
/* point 2 */ AfxMessageBox( _T("2") );
return ret;
}
}
return CExtGridWnd::OnGbwAnalyzeCellMouseClickEvent(
nChar, nRepCnt, nFlags, point);
}
|
|
Technical Support
|
May 17, 2007 - 11:30 AM
|
We used your version of the OnGbwAnalyzeCellMouseClickEvent() method in the CDemoGrid class in the SimpleGrids sample application: virtual bool OnGbwAnalyzeCellMouseClickEvent(
UINT nChar,
UINT nRepCnt,
UINT nFlags,
CPoint point
)
{
ASSERT_VALID(this);
CExtGridHitTestInfo htInfo(point);
HitTest( htInfo, false, true );
if (VK_LBUTTON == nChar
&& ( !htInfo.IsHoverEmpty() || htInfo.IsValidRect() ) // A valid location in the grid
&& 0 == htInfo.GetInnerOuterTypeOfColumn() // An inner column cell
&& 0 == htInfo.GetInnerOuterTypeOfRow()) // An inner row cell
{
if (2 == nRepCnt)
{
bool ret = CExtGridWnd::OnGbwAnalyzeCellMouseClickEvent(
nChar, nRepCnt, nFlags, point);
// GetOwner()->SendMessage(WM_GRID_DBLCLK, htInfo.m_nColNo, htInfo.m_nRowNo);
return ret;
}
else if (nRepCnt < 2)
{
bool ret = CExtGridWnd::OnGbwAnalyzeCellMouseClickEvent(
nChar, nRepCnt, nFlags, point);
// GetOwner()->SendMessage(WM_GRID_CLK, htInfo.m_nColNo, htInfo.m_nRowNo);
return ret;
}
}
return CExtGridWnd::OnGbwAnalyzeCellMouseClickEvent(
nChar, nRepCnt, nFlags, point);
} All the grids in this sample application are derived from the CDemoGrid with different selection models and grid cell highlighting options. We did not see any crashes when using Prof-UIS 2.64. But, as you may have noted, we commented out the WM_GRID_CLK code because we have no idea what the message handler for it should do? May be, you will be able to repeat the same experiment May be we need to know some more details about how should we double click the grid cell, were exactly and which cell type should be used?
|
|
Patrick Gallagher
|
May 17, 2007 - 7:57 AM
|
I have a property grid with a category containing CExtGridCellBool cells displayed as check boxes. I want to be able to programatically check all the items in the category or clear the items. I added custom buttons to the property grid toolbar and in my overriden OnCmdMsg handler I do the following to enumerate and check all the items:
CExtPropertyStore* store = PropertyStoreGet(); CExtPropertyItem* myCat = store->ItemGetByName(_T("Category"));
if ( myCat != NULL ) { int nItems = myCat->ItemGetCount(); for ( int idx = 0; idx < nItems; ++idx ) { CExtPropertyItem* item = myCat->ItemGetAt( idx ); if ( item != NULL ) { CExtGridCellBool* pValue = STATIC_DOWNCAST( CExtGridCellBool, item->ValueActiveGetByRTC( RUNTIME_CLASS(CExtGridCellBool) ) ); pValue->DataSet(true); } } }
This does not work. What is the proper way to programatically set the values?
|
|
Technical Support
|
May 17, 2007 - 10:42 AM
|
The CExtPropertyGridCtrl class is designed to be a container for one or more tree grid windows ( CExtPropertyGridWnd -derived classes) displaying the content of the property store. The tree grid windows contain copies of grid cells stored in the property store. When some grid cell changes in the active tree grid window inside the property grid control, then all the grid cells in the in-active tree grid windows and property store get automatically synchronized. If you programmatically change active grid cells in some property values inside the property store, you should finally invoke the CExtPropertyGridCtrl::PropertyStoreSynchronize() method to synchronize all the grid cells in the tree grids.
|
|
Chris Anderson
|
May 16, 2007 - 8:19 PM
|
When invoking DoModal on an instance of CExtIconEditDlg dialog I get an assertion from MFC in the DoDataExchange method of CExtIconEditDlg. More specifically the trace message from MFC indicates that it is not able to find the IDC_IMAGE_EDITOR control within the dialog. I am using the DLL version of Prof UIS. Is there anything wrong that I am doing? Any ideas as to what the issue is since I do not get this problem with any of Prof UIS samples.
|
|
Technical Support
|
May 17, 2007 - 10:39 AM
|
The icon editor dialog CExtIconEditDlg is used in the IconEditor sample. You can see how it is opened with the DoModal() in the CMainDlg::OnButtonEdit() method. It works OK. Would you send us a test project that demonstrates what’s wrong?
|
|
Michael Doyle
|
May 16, 2007 - 4:02 PM
|
Dear Tech Support,
I use CExtGridWnd in a CExtResizableDialog, then embeded the dialog box into a folder of Page Navigator.
All other native controls such as static, radio, text box etc show just fine, the grid control does not.
If I not override WindowProc, the grid area show up as unpainted white block; If I override WindowProc and do WM_PAINT as sample, the grid area is completely blank, just like the normal background.
Any suggestion on how to handle this?
Thanks
|
|
Michael Doyle
|
May 18, 2007 - 8:01 AM
|
|
|
Michael Doyle
|
May 17, 2007 - 2:00 PM
|
Please give me an email address to send over the whole source code.
|
|
Technical Support
|
May 18, 2007 - 5:10 AM
|
|
|
Michael Doyle
|
May 17, 2007 - 8:30 AM
|
I simply modified PageNavigator sample code to replicate this.
I am using VC6.0 (SP3), and compile MBS static with MFC DLL.
1. I create dialog box CGridTestDlg containing one static text and one custom control (copied from grid page of ProfUIS_Controls sample).
2. Map the grid to dialog box member CExtGridWnd m_wndGrid as the control sample.
3. Add the dialog box to CMainFrame and add the dialog to the first view of mail folder.
class CMainFrame... { ....
/************** Argent Software Test Code ***************************/
CGridTestDlg m_wndGridTest;
/*******************************************************************/ .... }
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { ...
CExtPageNavigatorWnd::PAGE_ITEM_INFO * pPII = m_wndPageNavigator.ItemInsert( -1, _T("Mail"), (HICON)::LoadImage( ::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_MAIL), IMAGE_ICON, 24, 24, 0 ), (HICON)::LoadImage( ::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_MAIL_SMALL), IMAGE_ICON, 16, 16, 0 ) );
/************** Argent Software Test Code ***************************/
m_wndGridTest.Create( CGridTestDlg::IDD, &m_wndPageNavigator );
pPII->PaneInsert( m_wndGridTest.GetSafeHwnd(), -1, _T("Grid Test View"), 300, true );
/*******************************************************************/
....
}
BTW, how can I attach the full source to this message? or I can email to you?
Thx
|
|
Technical Support
|
May 17, 2007 - 11:31 AM
|
Your code is absolutely correct but it does not cover all the details you provided. Is it possible to create a stripped version of your project containing UI code only and send it to us?
|
|
Technical Support
|
May 17, 2007 - 3:12 AM
|
You can create the grid window as a child of any other window including as you did this. We need to look at the source code which creates the grid, dialog and page navigator windows. Of course, if you would send us a test project, that would even be better and let us help you faster.
|
|
delu qiu
|
May 16, 2007 - 8:58 AM
|
Hi,
The view window can display background picture with Prof-UIS 2.61, but can not display background picture with Prof-UIS 2.64. I applied Aqua skin to the view window.
class CMainView :public CExtWA < CExtWS < CExtAFV < CFormView > > > //class CMainView : public CFormView { protected: CMainView(); // protected constructor used by dynamic creation DECLARE_DYNCREATE(CMainView)
// Form Data public: int DEF_VSPACE,DEF_HSPACE,DEF_BUTTON_HEIGHT,DEF_LOGO_HEIGHT,DEF_DLG_WIDTH,DEF_DLG_HEIGHT; int DEF_TABWIDTH; //{{AFX_DATA(CMainView) enum { IDD = IDD_FORMVIEW }; CExtButton m_btnISZ4; CExtButton m_btnISZ3; CExtButton m_btnISZ2; CExtButton m_btnISZ1; CExtButton m_btnAUDI4; CExtButton m_btnAUDI3; CExtButton m_btnAUDI2; CExtButton m_btnAUDI1; CExtButton m_btnVW4; CExtButton m_btnVW3; CExtButton m_btnVW2; CExtButton m_btnVW1; CExtButton m_btnMZD4; CExtButton m_btnMZD3; CExtButton m_btnMZD2; CExtButton m_btnMZD1; CExtButton m_btnSATU6; CExtButton m_btnSATU5; CExtButton m_btnSATU4; CExtButton m_btnSATU3; CExtButton m_btnSATU2; CExtButton m_btnSATU1; CExtButton m_btnTOY5; CExtButton m_btnTOY4; CExtButton m_btnTOY3; CExtButton m_btnTOY2; CExtButton m_btnTOY1; CExtButton m_btnHOD4; CExtButton m_btnHOD3; CExtButton m_btnHOD2; CExtButton m_btnHOD1; CExtButton m_btnGen3; CExtButton m_btnGen2; CExtButton m_btnGen1; CExtButton m_btn2534GP7; CExtButton m_btn2534GP6; CExtButton m_btn2534GP5; CExtButton m_btn2534GP4; CExtButton m_btn2534GP3; CExtButton m_btn2534GP2; CExtButton m_btn2534GP1; CExtButton m_btnChry7; CExtButton m_btnChry6; CExtButton m_btnChry5; CExtButton m_btnChry4; CExtButton m_btnChry3; CExtButton m_btnChry2; CExtButton m_btnChry1; CExtButton m_btnFord6; CExtButton m_btnFord5; CExtButton m_btnFord4; CExtButton m_btnFord3; CExtButton m_btnFord2; CExtButton m_btnFord1; CExtButton m_btnGM6; CExtButton m_btnGM5; CExtButton m_btnGM4; CExtButton m_btnGM3; CExtButton m_btnGM2; CExtButton m_btnGM1; CLeftTab m_tab; //}}AFX_DATA
// Attributes public: CString strPopupFile1; CString strPopupFile2; CString strPopupFile3; CString m_GMWEB_Path; CString strHlpfile; CString hlpcmd; CString strInstallPath; CString strExeVUW; CString strDirVUW; CString strExeCUW; CString strDirCUW; CString strExeFMP; CString strDirFMP; PROCESS_INFORMATION prInfo; STARTUPINFO stInfo;
PROCESS_INFORMATION prInfo1; STARTUPINFO stInfo1;
// Operations public: void ShowHH(CString page); void HideButtons(); BOOL ShowTaskManager(int menu_index); BOOL GetInstallFolder(); BOOL GetHlpDir(); BOOL RunProcess(CString sCmdLine,CString sCurDir); COLORREF colorBK;
// Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMainView) public: virtual void OnInitialUpdate(); protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL
// Implementation protected: int nCurTab; void SetPosbyRowCol(CWnd * pWnd,int nRows, int nCols, int iRow, int iCol); BOOL SetItemPos(); BOOL ShowTab(); void SetUI(); virtual ~CMainView(); #ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const; #endif
// Generated message map functions //{{AFX_MSG(CMainView) afx_msg void OnPaint(); afx_msg void OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnTimer(UINT nIDEvent); afx_msg void OnBtnGm1(); afx_msg void OnBtnGm2(); afx_msg void OnBtnGm3(); afx_msg void OnBtnGm4(); afx_msg void OnBtnGm5(); afx_msg void OnBtnGm6(); afx_msg void OnBtnFord1(); afx_msg void OnBtnFord2(); afx_msg void OnBtnFord3(); afx_msg void OnBtnFord4(); afx_msg void OnBtnFord5(); afx_msg void OnBtnFord6(); afx_msg void OnBtnChrysler1(); afx_msg void OnBtnChrysler2(); afx_msg void OnBtnChrysler3(); afx_msg void OnBtnChrysler4(); afx_msg void OnBtnChrysler5(); afx_msg void OnBtnChrysler6(); afx_msg void OnBtnChrysler7(); afx_msg void OnBtnGernal1(); afx_msg void OnBtnGernal2(); afx_msg void OnBtnGernal3(); afx_msg void OnBtn2534gp1(); afx_msg void OnBtn2534gp2(); afx_msg void OnBtn2534gp3(); afx_msg void OnBtn2534gp4(); afx_msg void OnBtn2534gp5(); afx_msg void OnBtn2534gp6(); afx_msg void OnBtn2534gp7(); afx_msg void OnBtnToy1(); afx_msg void OnBtnToy2(); afx_msg void OnBtnToy3(); afx_msg void OnBtnToy4(); afx_msg void OnBtnHod1(); afx_msg void OnBtnHod2(); afx_msg void OnBtnHod3(); afx_msg void OnBtnHod4(); afx_msg void OnBtnSatu1(); afx_msg void OnBtnSatu2(); afx_msg void OnBtnSatu3(); afx_msg void OnBtnSatu4(); afx_msg LRESULT OnShowTab(WPARAM wParam, LPARAM lParam); afx_msg void OnBtnMzd1(); afx_msg void OnBtnVw1(); afx_msg void OnBtnIsz1(); afx_msg void OnBtnToy5(); afx_msg void OnBtnMzd2(); afx_msg void OnBtnMzd3(); afx_msg void OnBtnMzd4(); afx_msg void OnBtnVw2(); afx_msg void OnBtnVw3(); afx_msg void OnBtnVw4(); afx_msg void OnBtnIsz2(); afx_msg void OnBtnIsz3(); afx_msg void OnBtnIsz4(); afx_msg void OnBtnAudi1(); afx_msg void OnBtnAudi2(); afx_msg void OnBtnAudi3(); afx_msg void OnBtnAudi4(); //}}AFX_MSG DECLARE_MESSAGE_MAP() };
void CMainView::OnPaint() { CPaintDC truedc(this);
CRect rcPage1,rcClient; GetClientRect(&rcPage1);
CDC dc; dc.CreateCompatibleDC(&truedc);
CBitmap bitmap; bitmap.CreateCompatibleBitmap(&truedc, rcPage1.Width(), rcPage1.Height()); CBitmap* pOldBitmap; pOldBitmap = dc.SelectObject(&bitmap);
CRect rect; GetClientRect(&rect);
CBrush brush; CBitmap bmp; if(bmp.LoadBitmap (IDB_BITMAP5)) { brush.CreatePatternBrush( &bmp); CDC::FromHandle(dc)->FillRect( &rect, &brush); }
CDC::FromHandle(truedc)->BitBlt(0, 0, GetSystemMetrics (SM_CXSCREEN), GetSystemMetrics (SM_CYSCREEN), &dc, 0, 0, SRCCOPY); }
|
|
Technical Support
|
May 16, 2007 - 10:22 AM
|
Please remove the OnPaint() handler method and add the WindowProc() virtual method:
LRESULT CMainView::WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
{
switch( message )
{
case WM_PAINT:
CPaintDC dcPaint( this );
CRect rcClient;
GetClientRect( &rcClient );
CExtMemoryDC dc( &dcPaint, &rcClient );
//
// FIRST STEP: Draw Prof-UIS themed background here
//
COLORREF clrBackground = GetBkColor();
bool bTransparent = false;
if( PmBridge_GetPM()->GetCb2DbTransparentMode(this)
&& ( clrBackground == COLORREF(-1L) )
)
{
CExtPaintManager::stat_ExcludeChildAreas(
dc,
GetSafeHwnd(),
CExtPaintManager::stat_DefExcludeChildAreaCallback
);
if( PmBridge_GetPM()->PaintDockerBkgnd( true, dc, this ) )
bTransparent = true;
}
if( (! bTransparent)
&& clrBackground != COLORREF(-1L)
)
dc.FillSolidRect(
&rcClient,
clrBackground
);
PmBridge_GetPM()->OnPaintSessionComplete( this );
//
// SECOND STEP: Draw your custom things into dc here
//
return 0L;
}
return CExtWA < CExtWS < CExtAFV < CFormView > > > :: WindowProc( message, wParam, lParam );
}
|
|
Ian McIntosh
|
May 16, 2007 - 7:27 AM
|
I have tried using: SetBkColor(RGB(0,100,0)); but this has no effect on the button’s appearance.
I have stepped into _RenderImpl() and can confirm that within that function GetBkColor() returns 25600 - and not (-1).
Also: SetTextColorHover(RGB(0,100,0)); seems to have no effect.
|
|
Ian McIntosh
|
May 16, 2007 - 12:05 PM
|
So how do I set the button colour?
I assume this must be possible as it is set to orange when I hover over the button.
|
|
Technical Support
|
May 17, 2007 - 12:11 PM
|
As we said above it is impossible to set the background color for a button when an Office 2007 theme is applied because these themes are based on bitmaps. As a workaround you could use, for example, the Office 2000 paint manager for your button. You can use a CExtPaintManagerCustomT template for that. You can find it here.
|
|
Technical Support
|
May 16, 2007 - 11:59 AM
|
The SetBkColor() method works only for the Office 2000/XP/2003 and Visual Studio 2005 themes. Otherwise it is useless because the buttons are based on bitmaps.
As for the SetTextColorHover() we confirm that this is not working under some themes but we already fixed this bug (Most likely the new version will be released tomorrow).
|
|
Geert Mys
|
May 16, 2007 - 1:45 AM
|
Dear,
In a MDI/SDI application a CExtToolControlBar calls the OnUpdateEditPaste, OnUpdateEditCopy, etc. works on the main view even if a window in a toobar has the focus.
e.g.: In ProfStudio-sample type some text in the command window and select it. Copy-button in the main toobar does not get enabled. Doing the same in de document-view-window, it does. e.g.: setting the focus to the command-window and pushing the past button, it paste in the document view and not in the command window.
In Visual Studio these buttons are synchronized with the Command-window in the examples given.
What is the appropriate way to change this behaviour?
Thank you for your support.
Geert
|
|
Technical Support
|
May 16, 2007 - 9:37 AM
|
Your question has to do with the MFC command routing only. In the main frame’s OnCmdMsg() virtual method, you shoudl invoke all OnCmdMsg() methods of all the windows which can affect the state of some commands in toolbars and menus. Besides, in all the windows like Command Windows referred in your message, you should analyze if they are focused when updating the states of commands.
|
|
Ian McIntosh
|
May 15, 2007 - 4:42 AM
|
Hi.
I am trying to add a combo box to a toolbar. I have got the combo box to display in the toolbar, but it appears empty and disabled.
I have the following -
in the .h:
CExtToolControlBar m_wndToolBar; CExtComboBox m_comboType;
in the .cpp:
// BLOCK 1: add a refresh button which works correctly. int nButtonsCount = m_wndToolBar.GetButtonsCount(); CGuiMdiApp::RegisterCommand(ID_STATE_BUT_REFRESH, m_wndToolBar, IDI_REFRESH, "refresh list" ); m_wndToolBar.InsertButton(nButtonsCount++, ID_STATE_BUT_REFRESH );
// BLOCK2: create the combo control to be added to the toolbar: if( !m_comboType.Create( WS_CHILD | WS_VISIBLE | CBS_DROPDOWN | CBS_HASSTRINGS, CRect( 0, 0, 200, 480 ), &m_wndToolBar, ID_COMBO_STATE_TYPE ) ) { ASSERT(FALSE); return -1; }
// BLOCK3: if I add this code, the combo box is at least displayed, although empty & disabled. CGuiMdiApp::RegisterCommand(m_comboType.GetDlgCtrlID(), m_wndToolBar, IDI_CLEAR, "State Type" ); m_wndToolBar.InsertButton(nButtonsCount++, m_comboType.GetDlgCtrlID() );
// BLOCK4: asserts if I dont have the code in block 3. m_wndToolBar.SetButtonCtrl( m_wndToolBar.CommandToIndex(ID_COMBO_STATE_TYPE), &m_comboType );
// BLOCK5 m_comboType.SetItemHeight( -1, 16 ); m_comboType.SetFont( &g_PaintManager->m_FontNormal );
// BLOCK6: the code in the FAQ has only 1 param for CmdGetPtr(). Anyway, this block doesn’t seem to do anything. g_CmdManager->CmdGetPtr( g_CmdManager->ProfileNameFromWnd( m_hWnd ), m_comboType.GetDlgCtrlID() )-> m_sMenuText = _T( "State Type" );
// BLOCK7: this data never seems to get displayed. m_comboType.AddString("One"); m_comboType.AddString("Two"); m_comboType.SetCurSel(0);
Would be grateful for any advice.
|
|
Ian McIntosh
|
May 15, 2007 - 9:37 AM
|
Thanks for swift and helpful answer. All now working.
|
|
Technical Support
|
May 15, 2007 - 8:20 AM
|
All the toolbar buttons are controlled by the MFC’s command updating mechanism in anu of the followind control bars: toolbar, menu bar, panel bar, ribbon page and ribbon bar. So, if a combo box button in your toolbar is assigned the ID_COMBO_STATE_TYPE command identifier, the main frame or dialog window should have the following methods and message map entries for this command:
// insert this into the message map of the main frame/dialog window
ON_UPDATE_COMMAND_UI(ID_COMBO_STATE_TYPE, OnUpdateMyCombo )
// insert this into the class declaration in the .H file
afx_msg void OnUpdateMyCombo( CCmdUI * pCmdUI );
// insert this into the class implementation in the .CPP file
void CMainFrame::OnUpdateMyCheck( CCmdUI * pCmdUI )
{
pCmdUI->Enable();
}
|
|
Chris Anderson
|
May 14, 2007 - 6:13 PM
|
I could display text to the left of image using CExtPaintManager__ALIGN_HORIZ_RIGHT. Also the text could be displayed to the right of the image using __ALIGN_HORIZ_LEFT. I need flags to diaply text at the top of the image and also at the bottom of the image. Please let me know how to achieve this feature?
Thanks,
|
|
Chris Anderson
|
May 15, 2007 - 12:52 PM
|
Yes, this feature is very much required. Otherwise we cannot use the CExtButton control!!!!. Is it possible to provide us the one-off enhancement for this at the earliest.
Thanks.
|
|
Technical Support
|
Jun 2, 2007 - 7:16 AM
|
We have just implemented this feature and sent you information about how to download the latest source code (profuis271(2007-06-01).zip) via email.
|
|
Technical Support
|
May 15, 2007 - 11:57 AM
|
Actually we implemented the left, center and right alignment for the icon only and there is no alignment option for other parts of the control like text text. So we can only regard your question as a feature request.
|
|
Christan HIRIGOYEN
|
May 14, 2007 - 9:43 AM
|
Hello,
I have a problem with CExtPageNavigatorWnd with Japanese characters in MBCS.
The text title in expanded shortcut list is well displayed, but the title in the currently selected page is wrong. The analysis is: The expanded shortcut list is drawn with the system font (which has Japanese characters). The title in the currently selected page is drawn with the ARIAL font Bold H20 (probably Arial font does not have Japanese characters) Is there anybody to confirm this?
Is there a way for end user to customize the font to use? Is there a general font to avoid such problem? There is probably the same problem with other language.
Thanks for your help.
|
|
Technical Support
|
May 14, 2007 - 11:22 AM
|
Please make sure that you have installed files for Eastern Asian Languages in the following way.
- Open Control Panel - Select Regional and Language options - Under the Languages tab check Install files for East Asian languages - Under the Advanced tab select Japanese for non-Unicode programs
|
|
Christan HIRIGOYEN
|
May 23, 2007 - 4:43 AM
|
Hello,
I have asked to check this, I can’t do it myself. The reponse is Yes, and it cannot be changed.
So are you sure Arial Font has Japanese Characters?
|
|
Technical Support
|
May 23, 2007 - 10:18 AM
|
We are not sure, anyway we would like to add a possibility to set the custom page navigator font as you asked in your first message. It sounds reasonable. We will done it in a couple of days and notify you about that.
|
|
tera t
|
May 14, 2007 - 3:09 AM
|
Hi
I do not want to use LoadToolbar in CExtToolControlBar
When direct want to take out BarButton. I want to dynamic change of BarButton in ControlBar
Is a program good in the following form?
HICON hIcon; hIcon = (HICON)::LoadImage( hInstResource, MAKEINTRESOURCE( IDI_ICON ), IMAGE_ICON, 32, 32, LR_VGACOLOR ); m_pCmdIconBox = new CExtCmdIcon; CExtCmdItem _cmd; _cmd.m_nCmdID = IDS_BARBUTTON; ASSERT( CExtCmdManager::IsCommand( _cmd.m_nCmdID ) ); pProfile->CmdSetup ( _cmd, false ); m_pCmdIconBox->AssignFromHICON( hIcon , TRUE ); pProfile->CmdSetIcon ( _cmd.m_nCmdID, m_pCmdIconBox , true );
m_toolbarBar.SetButtons( IDS_BARBUTTON , 1 );
|
|
Technical Support
|
May 14, 2007 - 8:31 AM
|
Here is the declaration of SetButtons() BOOL SetButtons(
const UINT* lpIDArray,
int nIDCount
); The method puts the controls specified by the lpIDArray pointer in the toolbar. It completely removes all the previous buttons. So if you need to change the specific button only, you should not use this method. You should use the InsertButton() and RemoveButton() methods instead.
|
|
tera t
|
May 14, 2007 - 6:36 PM
|
Hi
It is not possible for an allotment of an icon in InsertButton.
I send a sample program. Is there the issue of anything?
Thanks,
|
|
Technical Support
|
May 15, 2007 - 10:19 AM
|
The toolbars and menus do not contain any icons. They get icons from the command manager. We have received your project and it’s OK. Do we need check for something else?
|
|
tera t
|
May 15, 2007 - 6:09 PM
|
Hi
>They get icons from the command manager. I did not understand structure well.
>We have received your project and it’s OK.
Thanks,
|
|
Technical Support
|
May 16, 2007 - 9:49 AM
|
The structure is very simple:
1) The toolbar contains only command identifiers of its buttons.
2) The global command manager contains a set of command profiles. Each command profile is attached to one or more windows (typically there is only one profile, which is attached to the main frame). The command profile contains an array of command descriptions. Each command descriptions contains an identifier, flags, text in toolbar, text in menu, tool tip, status tip and icon.
How can toolbar find icon when it knows only the buttons command identifier? First of all, the toolbar should find its command profile in the command manager. It can be found using toolbar’s window handle. If there are no command profile in the command manager attached to toolbar handle, then it gets toolbar’s parent window and searches for its command profile and so on. In the typical case, walking through parent window chain is stopped at the main frame window which is attached to the command profile in the command manager. The command profile contains map from the command identifier to the CExtCmdItem command description object which includes all the required information about the command including its icon.
|
|
Rado Manzela
|
May 14, 2007 - 1:28 AM
|
I’m using this frame window: class CMainFrame : public CExtNCW < CFrameWnd > I need to do some action when user minimizes the application, but overrided OnSysCommand() is never called, only once when application is closed.
Other thing is that CExtPopupMenu::TrackPopupMenu() is not working properly when its parent window is not foreground window. Clicking to another application does not hide the menu and clicking to menu command asserts (I don’t have the line# here but I can check it later if you need it) - you can reproduce this for example when you insert icon into system tray and will try to create the popup menu after clicking to this icon.
Thank you.
|
|
Rado Manzela
|
May 16, 2007 - 5:11 AM
|
Thank you, I was just wondering what was the reason for not calling user’s OnSysCommand(). Have you looked at the problem with meni in the sample?
|
|
Technical Support
|
May 16, 2007 - 9:53 AM
|
The WindowProc() virtual method of the CExtNCW template class invokes the PreWindowProc() and PostWindowProc() methods of the CExtNcFrameImpl class where required for skinning messages are handled. The CExtNcFrameImpl class is base of the CExtNCW template class but not the first in the inheritance list. The first base class of the CExtNCW template class is always CWnd -based class. It is not possible to access CWnd handlers map from the CExtNcFrameImpl class methods.
The menu problem is not a problem. It is the requirement both for Prof-UIS and Win32 menus: the thread which will track the menu should bring some of its windows to foreground.
|
|
Rado Manzela
|
May 16, 2007 - 11:48 AM
|
Menu problem:
It is strange. How can you implement popup menu after right click on the application’s tray icon when application is hidden? I don’t have that project here but I think it was working for me with standard CMenu and it is not working with CExtPopupMenu
|
|
Technical Support
|
May 16, 2007 - 12:18 PM
|
The SetForegroundWindow() API relates both to the visible and invisible windows absolutely equally. And you should use it in exactly the same way with Prof-UIS and MFC/Win32’s menus.
|
|
Rado Manzela
|
May 17, 2007 - 3:06 AM
|
thank you, it works with SetForegroundWindow()
|
|
Rado Manzela
|
May 15, 2007 - 2:15 AM
|
Don’t you plan to call user’s OnSysCommand() handler in future?
Here is sample project for the menu (try the view’s context menu) : http://rrrado.szm.sk/sdi.zip
|
|
Technical Support
|
May 15, 2007 - 10:24 AM
|
You can add the following virtual to the CMainFrame() class to test events received when the frame is closed: LRESULT CMainFrame::WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
{
if( message == WM_SYSCOMMAND && wParam == SC_CLOSE )
{
::AfxMessageBox( _T("Exiting via SC_CLOSE system command") );
}
if( message == WM_COMMAND && wParam == ID_APP_EXIT )
{
::AfxMessageBox( _T("Exiting via ID_APP_EXIT MFC’s command") );
}
if( message == WM_CLOSE )
{
::AfxMessageBox( _T("WM_CLOSE message received") );
}
return CExtNCW < CFrameWnd > :: WindowProc( message, wParam, lParam );
} You will see that the WM_CLOSE notification is the most universal in the case of closing the main frame window by the user. The frame can be closed through 1) ALT+F4 2) Clicking the X button 3) Double clicking the caption icon 3) File | Exit menu If the DestroyWindow() API is invoked programmatically, then you will not receive the WM_CLOSE message.
|
|
Technical Support
|
May 14, 2007 - 9:04 AM
|
1. The WM_SYSCOMMAND message is completely handled by the CExtNCW::WindowProc() virtual method if the paint manager implements skinned non-client window areas. So if you handle this message in the CMainFrame::WindowProc() virtual method before invoking the CExtNCW < CFrameWnd > :: WindowProc() parent class method, that may fix the problem.
2. Would you send us some sample project that reproduces this problem?
Thank you.
|
|
Andrew Banks
|
May 13, 2007 - 1:52 PM
|
Can’t find doc or samples that describe how to use grid cell tooltips.
Can you please help.
Thanks
|
|
Technical Support
|
May 14, 2007 - 8:39 AM
|
You can set custom tooltip text for a cell by overridding the CExtGridCell::OnInitToolTip() method in the cell class like as follows: // DECLARATION
class CExtGridCellTooltip : public CExtGridCell
{
public:
DECLARE_SERIAL( CExtGridCellTooltip );
IMPLEMENT_ExtGridCell_Clone( CExtGridCellTooltip, CExtGridCell );
CExtGridCellTooltip(
CExtGridDataProvider * pDataProvider = NULL
);
// virtual methods
virtual bool OnInitToolTip(
CExtGridWnd & wndGrid,
const CExtGridHitTestInfo & htInfo,
CToolTipCtrl & wndToolTip,
UINT nToolNo,
const RECT & rcTool
);
}; // class CExtGridCellTooltip
//IMPLEMENTATION
/////////////////////////////////////////////////////////////////////////////
// CExtGridCellTooltip
IMPLEMENT_SERIAL( CExtGridCellTooltip, CExtGridCell, VERSIONABLE_SCHEMA|1 );
CExtGridCellTooltip::CExtGridCellTooltip(
CExtGridDataProvider * pDataProvider // = NULL
)
: CExtGridCell ( pDataProvider )
{
}
bool CExtGridCellTooltip::OnInitToolTip(
CExtGridWnd & wndGrid,
const CExtGridHitTestInfo & htInfo,
CToolTipCtrl & wndToolTip,
UINT nToolNo,
const RECT & rcTool
)
{
ASSERT_VALID( this );
ASSERT_VALID( (&wndGrid) );
ASSERT( ! htInfo.IsHoverEmpty() );
ASSERT( htInfo.IsValidRect() );
htInfo;
bool bRetVal = false;
CExtSafeString strText( _T("Tooltip Text") );
if( strText.GetLength() > 0 )
{
wndToolTip.AddTool(
&wndGrid,
(LPCTSTR)strText,
&rcTool,
nToolNo
);
bRetVal = true;
}
if( ! bRetVal )
{
wndToolTip.DelTool( &wndGrid, nToolNo );
CWnd::CancelToolTips();
} // if( ! bRetVal )
return bRetVal;
} Here is how you can use it CExtGridCellTooltip * pCellTooltip =
STATIC_DOWNCAST(
CExtGridCellTooltip,
m_wndGrid.GridCellGet(
4,
nRowNo,
0,
0,
RUNTIME_CLASS(CExtGridCellTooltip)
)
); Please note you should disable the content pop-up window for grid cells. Such a tooltip-like window shows the cell content for a cell which is partially visible. m_wndGrid.EnableTooltips(
true,
true,
true,
true,
true
);
m_wndGrid.EnableExpanding(
false,
false,
false,
false,
false
);
|
|
Offer Har
|
May 11, 2007 - 2:13 PM
|
Dear Support,
How can i use a skinned scroll-bars in CExtEdit ? In general - may I suggest that you’ll supply a comprehensive seamless solution to the scroll-bars skinning? We meet it quite a lot...
Thanks, Ron.
|
|
Technical Support
|
May 14, 2007 - 9:03 AM
|
We are going to improve the CExtNCW template classes by adding support for skinning non-client areas including that in the scroll bar s. Currently only hook-based scroll bar skinning is available (what you are using now).
|
|