Subject |
Author |
Date |
|
delu qiu
|
May 5, 2006 - 8:24 AM
|
In VC6 Resource, I set a group box horizontal alignment to right,
after I use CExtGroupBox instead of CStatic to implement the groupbox, the horizontal alignment no longer work.
Any suggestion?
Thanks
|
|
Technical Support
|
May 5, 2006 - 11:41 AM
|
Thank you for the bug report. We will fix this bug in the next minor release. At the moment you can assign the text alignment with the SetTextAlign() method: m_wndGroupBox.SetTextAlign( CExtGroupBox::ALIGN_CENTER );
|
|
delu qiu
|
May 5, 2006 - 8:12 AM
|
Hi,
I have a MFC dialog-base project, and I’m trying apply skin to the main dialog CSPSSelection, In SPSSelection.h, I write class CSPSSelection:public CExtNCW < CExtResizableDialog> { CSPSSelection(CWnd* pParent = NULL); // standard constructor .... }
but I got compile error in SPSSelection.cpp: SPSSelection.cpp(31) error C2614: ’CSPSSelection’ : illegal member initialization: ’CExtResizableDialog’ is not a base or member
this is my code: CSPSSelection::CSPSSelection(CWnd* pParent /*=NULL*/) : CExtResizableDialog(CSPSSelection::IDD, pParent) { //{{AFX_DATA_INIT(CSPSSelection) //}}AFX_DATA_INIT }
How to fix this? thanks
|
|
Technical Support
|
May 5, 2006 - 11:40 AM
|
Please replace the following code: CSPSSelection::CSPSSelection(CWnd* pParent /*=NULL*/)
: CExtResizableDialog(CSPSSelection::IDD, pParent)
{
//{{AFX_DATA_INIT(CSPSSelection)
//}}AFX_DATA_INIT
} with: CSPSSelection::CSPSSelection(CWnd* pParent /*=NULL*/)
: CExtNCW < CExtResizableDialog > ( CSPSSelection::IDD, pParent )
{
//{{AFX_DATA_INIT(CSPSSelection)
//}}AFX_DATA_INIT
}
|
|
delu qiu
|
May 5, 2006 - 9:53 AM
|
Done, I changed my code to CSPSSelection::CSPSSelection(CWnd* pParent /*=NULL*/) : CExtNCW < CExtResizableDialog > ( CSPSSelection::IDD,pParent )
Got another question, some MFC resource Properties seems not work after migrate to prof-uis control. for example,control order property and Transparent property
|
|
Technical Support
|
May 5, 2006 - 11:55 AM
|
Please ensure you have subclassed all the controls in your dialog with Prof-UIS classes. We recommend you specify the WS_CLIPSIBLINGS and WS_CLIPCHILDREN styles for your dialog. If you have group boxes, then please check that the tab order number of each group box is greater than tab order numbers of all the controls inside the group box.
|
|
Sergio Buonanno
|
May 5, 2006 - 6:26 AM
|
I have a MDI application with MDI Tabs. Each MDI Child Window contains an CExtResizableDialog dialog box that overlaps the entire client area of the MDI Child Window. The some child dialogs contain TAB controls with static and radio-button controls that do not draw properly when the application run under Windows XP with a theme enabled (they appear black). I found a work around on the problem (see the code below), but when I resize the application controls on the bottom side of the window are still painted black. The application was originally developed without Prof-UIS and I cannot replace all static and radio-buttons because I have hundreds of windows to change, not only this, dialogs may contain some custom ActiveX controls that have the same problem. How can I manage to create a dialog window that has a bitmap background and transparent static, checkbox, ActiveX and radio-button controls with Prof-UIS ? I mean, I would like to create an application with custom themes (not only Windows XP themes) using bitmaps as background of CExtResizableDialog dialogs, at the same time, I would like to have the possibility to use Prof-UIS controls, Windows controls and ActiveX controls in my CExtResizableDialog derived windows.
void CDlgProtect::UpdateBackgroundBrush(void) { if (m_bThemeActive == 0) { HMODULE hinstDll;
// Check if the application is themed hinstDll = LoadLibrary(_T("UxTheme.dll")); if (hinstDll) { typedef BOOL (*ISAPPTHEMEDPROC)(); ISAPPTHEMEDPROC pIsAppThemed; pIsAppThemed = (ISAPPTHEMEDPROC) ::GetProcAddress(hinstDll, "IsAppThemed");
if(pIsAppThemed) m_bThemeActive = pIsAppThemed() ? 0xFF: 1;
FreeLibrary(hinstDll); } }
// Destroy old brush m_brushCtrls.DeleteObject();
// Only do this if the theme is active if (m_bThemeActive && !m_bmpBackImage.m_hObject) { CRect rc; CDC memDC;
GetClientRect(rc); m_bmpCtrlsBackground.DeleteObject(); CDC *pdcDlg = GetDC(); memDC.CreateCompatibleDC(pdcDlg); m_bmpCtrlsBackground.CreateCompatibleBitmap(pdcDlg, rc.Width(), rc.Height()); CBitmap *pOldBmpDest = memDC.SelectObject(&m_bmpCtrlsBackground); ReleaseDC(pdcDlg); g_PaintManager->PaintControlBarClientArea(memDC, rc, this); m_brushCtrls.CreatePatternBrush(&m_bmpCtrlsBackground); memDC.SelectObject(pOldBmpDest); } }
HBRUSH CDlgProtect::OnCtlColor(CDC* pDC, CWnd *pWnd, UINT nCtlColor) { if (m_bThemeActive) { CString sClassName; GetClassName(*pWnd, sClassName.GetBuffer(128), 128); sClassName.ReleaseBuffer(); if (sClassName.CompareNoCase(_T("button")) == 0 || sClassName.CompareNoCase(_T("static")) == 0 || sClassName.CompareNoCase(_T("#32770")) == 0)//Dialog { RECT rc;
// Set the background mode to transparent pDC->SetBkMode(TRANSPARENT);
pWnd->GetWindowRect(&rc);
// Map coordinates to the upper left corner of parent dialog window ScreenToClient(&rc);
// Adjust the position of the brush for this control (else we see the top left of the brush as background) VERIFY(SetBrushOrgEx(*pDC, -rc.left, 0, NULL)); return m_brushCtrls; } } else { CString sClassName; GetClassName(*pWnd, sClassName.GetBuffer(128), 128); sClassName.ReleaseBuffer(); if (sClassName.CompareNoCase(_T("static")) == 0 || sClassName.CompareNoCase(_T("#32770")) == 0)//Dialog { pDC->SetBkMode(TRANSPARENT); return (HBRUSH)GetStockObject(NULL_BRUSH); } } return CExtResizableDialog::OnCtlColor(pDC, pWnd, nCtlColor); }
|
|
Technical Support
|
May 5, 2006 - 11:37 AM
|
Please compile and run the TabbedBars sample, select the green "Other Options" tab page and set on two first check marks on it. You will see the custom drawn background which is consistent in all the dialog controls. This is possible because Prof-UIS paint managers support custom background painting. First of all you should invoke the g_PaintManager->m_bCustomBackgroundInharitanceEnabled = true; code to enable the custom background painting for the currently installed paint manager. Second, handle the CExtPaintManager::g_nMsgPaintInheritedBackground registered Windows message in the window which should have a custom background including all the child windows. The CChildView class in the TabbedBars sample application is a One Note tab page container window which handles the CExtPaintManager::g_nMsgPaintInheritedBackground registered Windows message in the CChildView::OnMsgPaintInheritedBackground() method to paint the background of the active page window. This message is also handled in the main frame window to paint custom background of entire frame. You can handle it in each of your dialog window.
|
|
Kailash Aynor
|
May 5, 2006 - 2:14 AM
|
While working with MDI_DynamicInnerOuterBars example I noticed that if you right click on "Outer Dynamic Bars" you get popup with options of (Float/Dock/tabbed document/hide). However if you rightclick "MDIDOC1" you dont get that popup. Is there an easy option to enable popup MDIDOC1.
|
|
Technical Support
|
May 5, 2006 - 11:24 AM
|
MDIDOC1 is associated with the simple MDI child frame window which is a completely different type of window. Why do you think it should have that menu?
|
|
Kailash Aynor
|
May 5, 2006 - 5:06 PM
|
Well you are limited to MainFrame Client screen area for all simple MDI child frames. Any child window that goes out, is clipped. This limits it usage in Multi-Monitor cases. However if you have Float option, like the one you have for OuterBars then you can easily move that window across monitors.
|
|
Technical Support
|
May 6, 2006 - 9:09 AM
|
We would like to draw your attention to a much simpler but equally featured application related to dynamic resizable control bars, which is SDI_DynamicBars. It is an SDI application which uses a tab page container as the main view window. Any dynamic control bar in the document mode is a child page window in the tab page container. This looks similar to the MDI tabbed interface, but the tab pages can only be maximized. Of course, any dynamic control bar can be switched into the floating mode and placed on any available monitor.
|
|
delu qiu
|
May 3, 2006 - 3:46 PM
|
Hi,
Just want to know is there any sample project demonstrate how to apply skin to CFormView? I put the formview into the CMDIFrameWnd and if I can apply skin to my owner-draw CTabCtrl? I did repaint for the tab control.
Thanks
|
|
Technical Support
|
May 5, 2006 - 11:32 AM
|
First of all, you need to make your form look consistent with the currently applied theme. This is described in the FAQ How to make CFormView to be look and act like CExtResizableDialog?. After that, the skin background will automatically be applied to your form view.
Prof-UIS provides a tab page container control implemented in the CExtTabPageContainerWnd class (the derived classes are CExtTabPageContainerOneNoteWnd , CExtTabPageContainerWhidbeyWnd and CExtTabPageContainerFlatWnd ). This control is a container for several page windows (usually dialogs) and it uses the Prof-UIS tab window for switching the active page window. You can find it in the TabPages and ProfUIS_Controls samples. So, just use the tab page container instead of CTabCtrl . The CTabCtrl control is incompatible with Prof-UIS themes. It is just a wrapper around the tab common control. And the CExtTabPageContainerWnd class is written from scratch and provides many useful features including support for themes skins.
|
|
delu qiu
|
May 5, 2006 - 12:45 PM
|
Thank you for your reply,
I have create a class CLeftTab which derived from CTabCtrl, and use ModifyStyle() to make the tabs position at left side, meantime the tab title is still keep horizontal orientation, and I put this control and some button into my CMainView which derived from CFormView. In addition, I re-paint CMainView and CLeftTab.
I got a problem after I apply AQUA style skin: CExtButton with AQUA style has a beautiful round corner, As I have to re-paint CMainView and CLeftTab, the CExtButton with AQUA style display with blemish outside of the round corner, I mean it no match the owner-drawed background of CMainView or CLeftTab. Can I remove the blemish outside of the round corner?
Is there any CExtTabxxxx support left side tab with horizontal orientation title?
Can I just keep my MFC derived class and write hybrid code?
|
|
delu qiu
|
May 5, 2006 - 3:30 PM
|
I use PatternBrush to paint my CLeftTab’s background with AQUA pattern, now the CExtButton looks comfortable with the container.
|
|
Technical Support
|
May 6, 2006 - 9:27 AM
|
We believe it is possible to code everything, but it would be much easier to use the CExtTabWnd class instead of CTabCtrl . The skinable paint manager does more than simply re-painting the background and tab items. It affects the layout of our tab window including margins of tab items and tab window. We do not see any reason to stick to the CTabCtrl class. Besides, the CExtTabPageContainerWnd class is a ready-to-use tab page container which features the CExtTabWnd window inside and manages tabbed switching between pages. So, you can use our tab window both independently and as part of the tab page container.
|
|
Denis Konovalov
|
May 3, 2006 - 10:06 AM
|
I’m use CExtBarUndoRedoButton derived class to implement undo button in my application. Button has SeparatedDropDown style, so list box opened by click on dropdown arrow. I want to close listbox by clickig again on dropdown arrow (as in MS Visual Studio) or on undo arrow. How can i do it?
Thanks.
|
|
Technical Support
|
May 3, 2006 - 10:45 AM
|
Thank you for your comment. Please update the CExtPopupControlMenuWnd::_OnMouseClick() method’s source code in the ../Prof-UIS/Src/ExtPopupCtrlMenu.cpp file: bool CExtPopupControlMenuWnd::_OnMouseClick(
UINT nFlags,
CPoint point,
bool & bNoEat
)
{
ASSERT_VALID( this );
bNoEat;
if( GetSafeHwnd() == NULL )
return false;
if( GetSite().GetAnimated() != NULL )
return true;
CExtPopupMenuSite & _site = GetSite();
if( _site.IsShutdownMode()
|| _site.IsEmpty()
|| _site.GetAnimated() != NULL
)
return true;
if( _IsTearOff() && CExtPopupMenuWnd::_HitTest(point) == IDX_TEAROFF )
{
bool bLButtonUpCall =
(nFlags==WM_LBUTTONUP || nFlags==WM_NCLBUTTONUP)
? true : false;
if( ! bLButtonUpCall )
_DoTearOff();
return true;
}
CPoint ptScreenClick( point );
ClientToScreen( &ptScreenClick );
HWND hWndFromPoint = ::WindowFromPoint( ptScreenClick );
if( hWndFromPoint != NULL
&& (::GetWindowLong(hWndFromPoint,GWL_STYLE)&WS_CHILD) != 0
&& ( m_hWndChildControl == hWndFromPoint
|| ::IsChild( m_hWndChildControl, hWndFromPoint )
)
)
{
bNoEat = true;
return false;
}
HWND hWndFocus = ::GetFocus();
if( hWndFocus != NULL
&& (::GetWindowLong(hWndFocus,GWL_STYLE)&WS_CHILD) != 0
&& ( m_hWndChildControl == hWndFocus
|| ::IsChild( m_hWndChildControl, hWndFocus )
)
)
{
bNoEat = true;
return false;
}
HWND hWndCapture = ::GetCapture();
if( hWndCapture != NULL
&& (::GetWindowLong(hWndCapture,GWL_STYLE)&WS_CHILD) != 0
&& ( m_hWndChildControl == hWndCapture
|| ::IsChild( m_hWndChildControl, hWndCapture )
)
)
{
bNoEat = true;
return false;
}
bool bPtInWndArea = _PtInWndArea( point );
if( bPtInWndArea )
{
if( m_bExcludeAreaSpec )
{
CRect rc = m_rcExcludeArea;
ScreenToClient( &rc );
if( rc.PtInRect( point ) )
{
bPtInWndArea = false;
bool bLButtonDownCall =
( nFlags == WM_LBUTTONDOWN || nFlags==WM_NCLBUTTONDOWN )
? true : false;
if( bLButtonDownCall )
{
_OnCancelMode();
return false;
}
}
}
}
if( ! bPtInWndArea )
{
if( m_pWndParentMenu != NULL
&& m_pWndParentMenu->GetSafeHwnd() != NULL
)
{
ASSERT_VALID( m_pWndParentMenu );
ClientToScreen( &point );
m_pWndParentMenu->ScreenToClient( &point );
HWND hWndOwn = GetSafeHwnd();
ASSERT( hWndOwn != NULL );
ASSERT( ::IsWindow(hWndOwn) );
CExtPopupMenuWnd * pWndParentMenu = m_pWndParentMenu;
bool bInplaceControlArea = false, bInplaceDropDownArea = false;
int nHtTemp =
pWndParentMenu->_HitTest(
point,
&bInplaceControlArea,
&bInplaceDropDownArea
);
if( nHtTemp >= 0 )
{
MENUITEMDATA & mi = pWndParentMenu->ItemGetInfo( nHtTemp );
if( mi.IsPopup()
&& mi.GetPopup() == this
)
{
if( bInplaceControlArea )
{
pWndParentMenu->_SetCapture();
pWndParentMenu->_ItemFocusCancel( FALSE );
pWndParentMenu->_ItemFocusSet( nHtTemp, FALSE, TRUE );
if( mi.IsAllowInplaceEditActivation() )
{
CWnd * pWndInplace = mi.GetInplaceEditPtr();
if( pWndInplace != NULL )
{
ASSERT_VALID( pWndInplace );
ASSERT( pWndInplace->GetSafeHwnd() != NULL && (::IsWindow(pWndInplace->GetSafeHwnd())) );
if( (pWndInplace->GetStyle() & WS_VISIBLE) == 0 )
{
CRect rcInplaceEdit;
pWndParentMenu->_GetItemRect( nHtTemp, rcInplaceEdit );
rcInplaceEdit =
mi.AdjustInplaceEditRect(
rcInplaceEdit,
OnQueryLayoutRTL()
);
pWndInplace->SetWindowPos(
NULL,
rcInplaceEdit.left, rcInplaceEdit.top,
rcInplaceEdit.Width(), rcInplaceEdit.Height(),
SWP_NOZORDER|SWP_NOOWNERZORDER
|SWP_NOACTIVATE|SWP_SHOWWINDOW
);
}
pWndInplace->SetFocus();
}
}
}
#if (!defined __EXT_MFC_NO_CUSTOMIZE)
CExtCustomizeCmdTreeNode * pNode = mi.GetCmdNode();
if( pNode == NULL )
return true;
if( (pNode->GetFlags()&__ECTN_TBB_SEPARATED_DROPDOWN) )
#endif
return true;
}
}
if( pWndParentMenu->_OnMouseClick(
nFlags,
point,
bNoEat
)
)
{
if( bNoEat )
return false;
if( ::IsWindow(hWndOwn) )
CancelMenuTracking();
return true;
}
return false;
}
if( nFlags == WM_RBUTTONUP
|| nFlags == WM_LBUTTONUP
)
return true;
_OnCancelMode();
return false;
}
bool bRetVal = false;
if( m_hWndChildControl != NULL
&& ::IsWindow( m_hWndChildControl )
)
{
CONTROLINPUTRETRANSLATEINFO _ciri(
this,
false,
nFlags,
point,
bNoEat
);
bRetVal =
( ::SendMessage(
m_hWndChildControl,
g_nMsgControlInputRetranslate,
(WPARAM)(&_ciri),
(LPARAM)0L
) != 0 )
? true : false;
}
return bRetVal;
}
|
|
Denis Konovalov
|
May 4, 2006 - 2:40 AM
|
|
|
jb lee
|
May 2, 2006 - 6:50 AM
|
I wanna use my own trackpopupmenu in a view. But my MDI’s formview shows the submenu of "View". How do I disable the default? or How do I pre-process my popup?
|
|
Technical Support
|
May 2, 2006 - 11:06 AM
|
We guess you want to disable the built-in Prof-UIS menu with the list of control bars. In this case, please add a message handler for the WM_CONTEXTMENU standard Windows message to your form view window. The handler method should have an empty body (do not invoke the parent class’s method in it).
|
|
jb lee
|
May 1, 2006 - 1:53 PM
|
I made two resizable dialogs. One is for main, the other is for reside in the main dialog(like your ProfUIS Control sample application). Main dialog has a group-box which is used for position and sizing of the child dialog. When I resize main dialog, child dialog remain it’s original position and size. Both of are derived from CExtResizableDialog and anchored at OnInitDialog(). Do I need some other work to do it?
|
|
Technical Support
|
May 2, 2006 - 11:04 AM
|
Initially you should use the group box control to position your child dialog(s) by invoking the MoveWindow() API. Then just anchor the child dialog inside the main dialog: CExtResizableDialog * pMainDialog = . . .
CWnd * pGroupBox = . . . // something like pMainDialog->GetDlgItem( ID_MY_GROUP_BOX )
CExtResizableDialog * pChildDialog = . . .
CRect rc;
pGroupBox->GetWindowRect( &rc );
pMainDialog->ScreenToClient( &rc );
pChildDialog->MoveWindow( &rc );
pMainDialog->AddAnchor( pChildDialog->m_hWnd, __RDA_LT, __RDA_RB );
|
|
jb lee
|
May 2, 2006 - 8:54 PM
|
Thanks, I omitted the last line.
|
|
Massimo Germi
|
Apr 29, 2006 - 6:20 AM
|
hi,
I have application that can switch to Full Screen mode and restore in normal state. In some situation automatically the application pass in full screen mode. When I work in full screen mode I don’t wont some CExtControlBar object, to hide its I use ShowControlBar(...). ShowControlBar method work only if the CExtControlBar object is docking or floating but when AutoHide is abilitated it daoesn’t work. The only method I found is keep in memory the state of any CExtControlBar and if is in AutoHide mode I temporaly dock and then hide, I don’t think is the beauty method.
Could you have any suggestion to Show/Hide CExtControlBar when is in AutoHide mode? When the CExtControlBar hided is restored it have to return in AutoHide mode.
TX a lot for any response.
|
|
Technical Support
|
Apr 30, 2006 - 7:35 AM
|
If you need to hide a simple control bar (not the dynamic control bar), you can do this with the following code: CExtControlBar * pBar = . . .
CMainFrame * pMainFrame = . . .
if( pBar->AutoHideModeGet() )
pBar->AutoHideModeSet( false, false, true, true );
else if( pBar->IsVisible() )
pMainFrame->ShowControlBar( pBar, FALSE, FALSE ); The FullScreenState sample supports two independent control bar states for the normal and full screen modes. This allows you to avoid tracking the state of each bar. As a result, the end user can set up the layout of control bars in each mode independently from each other.
|
|
Massimo Germi
|
May 1, 2006 - 7:11 AM
|
OK, this work fine if I have bar objects created in CMainFrame window, but it seems does not work if I create a bars in CChildFrame.
Is a problem of my code or I have to use another method?
Thanks a lot
|
|
Technical Support
|
May 1, 2006 - 12:16 PM
|
We cannot confirm that this does not work. The code snippet in our previous message in this thread works for the resizable control bar inside any kind of CFrameWnd window. If your bar is in the MDI child frame window: CExtControlBar * pBar = . . . // bar that is inside your child frame
CMDIChildWnd * pChildFrame = . . . // your CChildFrame - NOT main frame!
if( pBar->AutoHideModeGet() )
pBar->AutoHideModeSet( false, false, true, true );
else if( pBar->IsVisible() )
pChildFrame->ShowControlBar( pBar, FALSE, FALSE );
Of course, if the problem persists, you can always send us a project that demonstrates the problem so we can help you.
|
|
Bob Sabiston
|
Apr 27, 2006 - 6:27 PM
|
I’m using a CExtGridCell-based class (Prof-UIS 2.50) to implement an interface component. After the columns are layed out and the header created, code like the following is used to populate the cells.
CExtGridCellString * pCellName = static_cast <CExtGridCellString *> (GridCellGet( 1L, m_iKnt, 0, 0, RUNTIME_CLASS(CExtGridCellString), false, false )); pCellName->TextSet(sName.c_str());
if (m_bInRedo) { pCellName->BackColorSet(CExtGridCell::__ECS_NORMAL, sm_BkClrRedo); pCellName->BackColorSet(CExtGridCell::__ECS_SELECTED, sm_BkHiClrRedo); } else { pCellName->BackColorSet(CExtGridCell::__ECS_NORMAL, sm_BkClrUndo); pCellName->BackColorSet(CExtGridCell::__ECS_SELECTED, sm_BkHiClrUndo); }
This code works fine and appears to set the background colors as desired (i.e., there is no failure so long as the window is not visible), but when the window becomes visible, I get a "Debug Assertion Failed" message. It seems to be this ASSERT in CExtGridCell::OnQueryBackColor():
if( clrBack != COLORREF(-1L) ) { DWORD dwSiwStyleEx = wndGrid.SiwGetStyleEx(); ASSERT( ( dwSiwStyleEx & (__EGBS_EX_HVI_EVENT_CELLS|__EGBS_EX_HVO_EVENT_CELLS) ) != 0 ); return clrBack; }
It is the case that neither of these options are not set, but I’m (currently) not interested in hovering behaviour, just customizing the normal and selected background colours. NOTE: Non-debug builds exhibit no problems, and the grid appears and behaves as expected. Suggestions?
|
|
Bob Sabiston
|
Apr 27, 2006 - 6:57 PM
|
1) In my initial post I neglected to include the most important code, that which sets the styles:
SiwModifyStyle( __ESIS_STH_ITEM | __ESIS_STV_ITEM | __EGBS_SFB_FULL_ROWS | __EGBS_GRIDLINES | __EGBS_NO_HIDE_SELECTION , 0, false );
SiwModifyStyleEx( __EGBS_EX_CELL_EXPANDING_OUTER_B , 0, false );
BseModifyStyle( 0L , __EGWS_BSE_DEFAULT, false );
2) I tried OR’ing EGBS_EX_HVI_EVENT_CELLS with the SiwModifyStyleEx() arg, and, sure enough, the problem went away!
This is good, but is still magic to me. Any information that might clarify what styles are required when would be greatly appreciated.
|
|
Technical Support
|
Apr 30, 2006 - 7:10 AM
|
The __EGBS_EX_HVI_EVENT_CELLS style, if applied, allows inner data cells to receive hover events. The __EGBS_EX_HVO_EVENT_CELLS style, if applied, allows outer header cells to receive hover events. The hover event allows you to change the font, text color, or background color of a cell when the cell gets hovered by the mouse pointer. You can do that in the CExtGridCell::OnHover() virtual method. Although these two styles can be used even if you do not need to change any cell styles, the grid control works faster if the hover events are not generated. In case of your grid, these styles should be used.
|
|
delu qiu
|
Apr 27, 2006 - 8:44 AM
|
Hi,
I got an CExtButton display problem. the CExtButton dispear after the application be switched off and switched back using ALT+TAB if meantime the CExtButton mouse overed. but CButton do not has this problem. There are two conditions cause problem: 1.CExtButton be mouse overed. 2.Main application be switched off and switched back.
My project is a single document application without document/view architecture support. I create class CMainView which inherited from CFormView as the main view of the application. And I put three controls in CMainView, they are CExtButton, CButton and a user-created CLeftTab which inherited from CTabCtrl. And, CMainView contains CLeftTab, and CLeftTab contains CExtButton and CButton.
I have to mention that CLeftTab and CMainView was redrawed by OnPaint(), both of them use GetClientRect() and FillRect() to redraw the background.
Does my code conflicts with CExtButton? Any suggestion would be appappreciated.
Thanks
|
|
Danny Parks
|
Jan 6, 2016 - 3:44 PM
|
What worked for me was removing WS_CLIPSIBLINGS from the ModifyStyle() call in CExtButton::PreSubclassWindow(). Then my group box could proceed the "child" controls in tab order as well.
|
|
delu qiu
|
Apr 27, 2006 - 9:27 AM
|
I am getting close to the bug, I think the CLeftTab conflicts with CExtButton. when I move the CExtButton out of the CLeftTab, there is no dispear problem.
|
|
delu qiu
|
Apr 27, 2006 - 10:17 AM
|
CLeftTab and CMainView redraw function removed, problem still exists.
|
|
Technical Support
|
Apr 27, 2006 - 11:20 AM
|
The problem can be easily fixed. First of all, please add the WS_CLIPSIBLINGS and WS_CLIPCHILDREN styles to the dialog template resource used by your form view window. Second, if there are some group boxes in this dialog template resource, please check the tab order for all the controls. The tab order number of each group box control should be greater that the tab order of any control "inside" the group box. Third, if your form view window is based on the CExtWS template class and enabled for horizontal and/or vertical scrolling, then you should handle the WM_HSCROLL and WM_VSCROLL standard Windows messages and repaint all the content including the form view window itself and all the child windows.
|
|
delu qiu
|
Apr 27, 2006 - 12:06 PM
|
I send a email attached my project to ’support@prof-uis.com’ before I received this tech support.
In the attached project I put three controls in CMainView, they are CExtButton, CButton and CTabCtrl. And, CMainView contains CTabCtrl, and CTabCtrl contains CExtButton and CButton.
And the problem in attached project was fixed by followed the first two point in tech support.
But the problem still exists in the original project.
|
|
Technical Support
|
Apr 30, 2006 - 11:49 AM
|
|
|
Bob Sabiston
|
Apr 26, 2006 - 12:58 PM
|
Hi: I would like to create a grid cell with a slider to control image opacity. CExtGridCellSlider seems to be appropriate but I haven’t seen any samples that use it nor any documentation on it in the help file. Do you have information on this class available?
Thanks BobSabiston
|
|
Technical Support
|
Apr 27, 2006 - 9:31 AM
|
The CExtGridCellSlider class features the same API as MFC’s CSliderCtrl class. Here is a simple test project that shows how to use this kind of cell.
|
|
jb lee
|
Apr 24, 2006 - 10:51 AM
|
I made a CExtGridWnd derived class ( likes the sample SimpleGrid ). Add a owner-drawn control into a formview, and subclassed the control into the class.
In a Formview’s function, I add some lines into the control. The problem is : the function works for a long time, so, I wanna view each added line when the line is added. But, before the function return, lines are not shown at all(only scroll bar is redrawn).
How do I force the added line be drawn on the control?
|
|
Technical Support
|
Apr 25, 2006 - 11:51 AM
|
Would you send us a test project that shows the problem?
|
|
Stephan Finkler
|
Apr 24, 2006 - 10:19 AM
|
Hi,
I have got a derived class from CExtToolControlBar. In this class there is a function to insert btns dynamicly. e.g. CMyToolBar::InsertBtn() { .... // register new special character if( nBtnCmdID >= nBtnCmdIDMin && nBtnCmdID <= nBtnCmdIDMax ) { // register new cmd for btn CExtCmdItem *pCmdItem = g_CmdManager->CmdAllocPtr( lpszProfileName, nBtnCmdID ); ASSERT( pCmdItem != NULL ); if( pCmdItem != NULL ) { CString ToolTip = pSCBtn->m_SpecialChar.HexCode + _T(" ") + pSCBtn->m_SpecialChar.Description; pCmdItem->m_sTipTool = ToolTip; pCmdItem->m_sTipStatus = ToolTip; pCmdItem->m_sToolbarText = pSCBtn->m_SpecialChar.cChar; pCmdItem->m_sMenuText = pSCBtn->m_SpecialChar.cChar;
// add btn to toolbar pSCBtn->SetCmdID(nBtnCmdID); VERIFY( InsertButton( -1, ID_SEPARATOR) ); VERIFY( InsertSpecButton( -1, pSCBtn) );
Customization is enabled and the toolbar is registered.
How can I add the dynamicly created buttons to customization subsystem (like in CExtCustomizeSite::OnRegisterToolBar)?
Thank for any help. Michael
|
|
Technical Support
|
Apr 25, 2006 - 11:30 AM
|
You should use a different approach when modifying customizable toolbar’s content because the toolbar is based on the CExtCustomizeCmdTreeNode tree-like data: get the active command tree node, change the array of its children and apply the modified node to the toolbar. Here is the sample code: CExtCustomizeSite * pSite = . . .
CExtToolControlBar * pToolBar = . . .
CExtCustomizeCmdTreeNode * pRootNode = pSite->GetToolbarCmdNode( pToolBar, false );
ASSERT_VALID( pRootNode );
// modify pRootNode here
pToolBar->RemoveAllNodes();
CExtCustomizeCmdTreeNode * pNewNode =
new CExtCustomizeCmdTreeNode( . . . );
pToolBar->InsertNode(
pSite,
pNewNode,
nInsertPosition // -1 - append
);
. . .
// update windows
pToolBar->SetButtons( pRootNode );
if( pToolBar->IsVisible() )
pToolBar->GetParentFrame()->RecalcLayout();
|
|
Massimo Germi
|
Apr 24, 2006 - 2:42 AM
|
Hi, I have an MDI application with CExtTabMdiOneNoteWnd control in CMainFrame. In some case active view can switch in full screen mode, there is a method to temporaly hide the all tabs in CExtTabMdiOneNoteWnd ? I wish to hide tabs when view switch in full screen mode and show its when view is restored in normal state.
Thanks a lot
|
|
Technical Support
|
Apr 24, 2006 - 12:21 PM
|
Just create a CExtTabMdiOneNoteWnd -derived class and implement the OnTabWndSyncVisibility() virtual method in it: class CYourTabs : public CExtTabMdiOneNoteWnd
{
virtual void OnTabWndSyncVisibility()
{
if( __IS_FULL_SCREEN_MODE__ )
{
if( (GetStyle()&WS_VISIBLE) != 0 )
ShowWindow( SW_HIDE );
return;
}
CExtTabMdiOneNoteWnd::OnTabWndSyncVisibility();
}
};
|
|
Massimo Germi
|
Apr 23, 2006 - 7:34 AM
|
HI, I have an MDI application with CExtTabMdiOneNoteWnd. I wish draw client area, of CView derived class, with color of current tab, in OnPaint function. How can I retrieve this color?
TX a lot
|
|
Technical Support
|
Apr 24, 2006 - 12:19 PM
|
In a view window you can get the parent frame window with CWnd::GetParentFrame() . The returned CFrameWnd pointer is actually the CMDIChildWnd window. If you invoke the CWnd::GetParentFrame() method for CMDIChildWnd, you will get your CMainFrame window. The CMainFrame class in your application should have a public property of CExtTabMdiOneNoteWnd type. This One Note MDI tab window is needed to find the colors corresponding to each view window. So, just walk through all the tab items by index and call CExtTabWnd::ItemLParamGet() for each of them. The returned LPARAM value is really an HWND window handle to the CMDIChildWnd window. So, you can find the tab item index which corresponds to your view window and then invoke the CExtTabOneNoteWnd::OnTabWndQueryItemColors() method to get the colors you need. You should specify false in both bHover and bSelected parameters. The pClrBkLight and pClrBkDark parameters are pointers to the COLORREF variables which will receive two colors of the One Note tab item.
|
|
Mark Walsen
|
Apr 22, 2006 - 1:48 PM
|
This is actually a PhotoShop sort of question, not a Prof-UIS question; but I’m hoping someone can help me here. My app allows the user to choose different color themes. The edges of some of my buttons do not blend well against incompatible colors. I need some of the edge pixels to be some sort of percentage blend between the background color and a foreground color. Is there a way I can use PhotoShop to create edges that do this sort of blending?
|
|
Technical Support
|
Apr 25, 2006 - 11:34 AM
|
Would you send us a screenshot that demonstrates the problem?
|
|
Mark Walsen
|
Apr 21, 2006 - 6:44 PM
|
My application was calling CMDIFrameWnd::RecalcLayout multiple times in a transaction, when only one final call was really needed. I suspect that I had this problem before I initroduced Prof-UIS into the application. But the extra calls to RecalcLayout noticeably slowed down the application when Prof-UIS was introduced. Also, the control bars would shuffle around, creating a distraction for the user.
I think I found a way to work around this problem. It might be even better than a work-around. It might actually be a good solution. I’d be interested in Prof-UIS Support’s opinion of this:
1. Add a BOOL m_bPendingPostMessage member to the CMainFrame.
2. In the CMainFrame, override CMDIFrameWnd::RecalcLayout: void CMainFrame::RecalcLayout(BOOL bNotify) { if (!m_bPostMessageRecalcLayoutPending) { m_bPostMessageRecalcLayoutPending = TRUE; PostMessage(WM_USER_PENDING_RECALC_LAYOUT, bNotify); } }
3. Handle the WM_USER_PENDING_RECALC_LAYOUT message as follows:
LONG CMainFrame::OnPendingRecalcLayout(UINT wParam, LONG) { CMDIFrameWnd::RecalcLayout((BOOL)wParam /* bNotify */); m_bPostMessageRecalcLayoutPending = FALSE; return 0; }
The control bars have really "calmed down" once I did this. It was such a easy solution, compared to hunting down all of the cases where there were redundant calls to RecalcLayout. I believe this solution does more than what the MFC CFrameWnd::m_bInRecalcLayout does, which is apparently to just avoid recursive calls, perhaps infinitely recursive calls.
Please let me know if you see any flaws in this.
Cheers -- Mark
|
|
Technical Support
|
Apr 22, 2006 - 7:08 AM
|
In most cases, when the main thread often becomes busy, using CFrameWnd::DelayRecalcLayout() is enough to make the frame layout re-computed and updated. This method simply modifies the CFrameWnd::m_nIdleFlags public property by adding the CFrameWnd::idleLayout flag. If your application periodically reaches the idle state, then the frame layout will be recomputed.
If the main UI thread is constantly busy like in the GLViews sample when animation is on, then you should do one of the following ways: 1) Let the message queue live. Invoke periodically the CExtPopupMenuWnd::PassMsgLoop() static method. It should be invoked after each long and heavy operation in the main UI thread. The GLViews sample application generates scene images in the second helper thread and passes the image surface to the main thread. The main thread invokes the CExtPopupMenuWnd::PassMsgLoop() static method after receiving an updated scene image from the second thread. This makes frame layout updated and allows you to perform mouse/keyboard input which is needed to see working toolbar buttons and menu items. If you do not need the mouse/keyboard input, you can use the CExtPaintManager::stat_PassPaintMessages() static method instead of CExtPopupMenuWnd::PassMsgLoop() . The CExtPaintManager::stat_PassPaintMessages() static method will process only painting messages pending in the message queue of the main UI thread. This will make all the windows updated. 2) You can use the timer in the main frame window which will check the ( ( ( CFrameWnd::m_nIdleFlags & CFrameWnd::idleLayout ) != 0 ) ? true : false ) condition. If it is true , then you should the CFrameWnd::DelayRecalcLayout() method. You can also check this condition without using the timer if you have any other kind periodically invoked code where this condition can be checked.
|
|
Emil Pop
|
Apr 21, 2006 - 8:16 AM
|
I believe the progress bar cell type shipped in the latest release is a very useful addition to the Prof-UIS suite.
I am wondering whether you intend to provide more controls supporting background tasks like open ended processes (e.g., processes whose ends cannot be determined at their start time)?!
A good example in this direction is the progress bar used by ’Incredibuild ’(a plug-in for Visual Studio that performs compilations spread across multiple machines).
I e-mailed you a Visio document where providing more details.
I would really appreciate I short answer providing some guidance ( like, "no, it is not our intention" or "possibly, next year/quarter", etc.)
Thanks,
Emil
|
|
Technical Support
|
Apr 21, 2006 - 11:02 AM
|
We do not see any difficulties in coding an incredibuild-like window with a collection of bars in it nor in coding a similar looking grid cell class or progress bar control. So we can discuss details of the control you need in your project(s).
|
|
Eddie Judson
|
Apr 20, 2006 - 11:10 PM
|
Is there an easy way of making the CExtEdit control act the same as the CExtGridCellCurrency? Thanks in advance, Eddie
|
|
Technical Support
|
Apr 21, 2006 - 7:30 AM
|
The CExtGridCellCurrency class uses the system GetCurrencyFormat() method which formats a number string into the currency for the specified locale. It is done in the CExtGridCellCurrency::TextGet() method. Please take a look at this method so you can implement the same functionality in your CExtEdit -derived class.
|