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 |
|
tera t
|
Jun 18, 2008 - 7:27 PM
|
Hello. Please teach how to use if you like.
In addition, will following how to use be permitted, too?
lpLayout->rect.top = 0
lpLayout->rect.bottom = 100
lpLayout->rect.left = 0
lpLayout->rect.right = 1000 CRect rcOwnLayout1;
rcOwnLayout1.top = 0
rcOwnLayout1.bottom = 100
rcOwnLayout1.left = 0
rcOwnLayout1.right = 500 ::AfxRepositionWindow(
lpLayout,
m_pDialog1->m_hWnd,
&rcOwnLayout1
); CRect rcOwnLayout2;
rcOwnLayout2.top = 0
rcOwnLayout2.bottom = 100
rcOwnLayout2.left = 501
rcOwnLayout2.right = 1000 ::AfxRepositionWindow(
lpLayout,
m_pDialog2->m_hWnd,
&rcOwnLayout2
); best regards
|
|
Technical Support
|
Jun 22, 2008 - 1:24 PM
|
The AfxRepositionWindow() function is an internal function in MFC. It does exactly the same as the DeferWindowPos() Win32 API does. The only difference is that the AfxRepositionWindow() function is using its own parameters based on a AFX_SIZEPARENTPARAMS data structure. Both APIs should be invoked between the BeginDeferWindowPos() and EndDeferWindowPos() Win32 APIs. If you forgot to invoke the n BeginDeferWindowPos() and EndDeferWindowPos() Win32 APIs, both AfxRepositionWindow() and DeferWindowPos() APIs will do nothing.
|
|
tera t
|
Jun 22, 2008 - 6:51 PM
|
Thank you for an answer.
Does not AfxRepositionWindow have the function to occupy a domain of MainFrame?
|
|
Technical Support
|
Jun 23, 2008 - 3:53 AM
|
The ::AfxRepositionWindow() API is used by child windows of the MFC frame window to take up some parts of frame side by side. The rest free space in the center is automatically used by a window with the dialog control identifier equal to AFX_IDW_PANE_FIRST . This is a view window in SDI frames and an MDI client area window (dark gray window, parent for MDI child frames) in MDI frames. The ::AfxRepositionWindow() API is typically used by MFC/Prof-UIS control bars to take up some parts of the frame window. But itās possible to make any kind of window to occupy the required space inside the MFC frame window or even any other window.
Some more details. When the windows inside the frame window or other window should be repositioned, the CFrameWnd::RecalcLayout() method is invoked in the case of frame windows and the CWnd::RepositionBars() method is invoked in the case of any other windows. In fact, invocation of the CFrameWnd::RecalcLayout(); code is the same as invocation of the CWnd::RepositionBars( 0, 0xFFFF, AFX_IDW_PANE_FIRST ); code. So, the CWnd::RepositionBars() method walks through all the child windows which have dialog control identifiers in the specified range (0 ... 0xFFFF ). The CWnd::RepositionBars() method can be used for repositioning child windows or only for computing the free central space. It sends the WM_SIZEPARENT message (internal message in MFC) to all the enumerated child windows and each child window handles it. You can see how this message is handled by Prof-UIS classes. For instance, the CExtTabWnd tab window handles this message in the CExtTabWnd::OnSizeParent() method and that is why MDI tabs are able to occupy the required space inside the MDI frame window. The CExtTabWnd control is able to take up the part of its parent window on left/right or at top/bottom. You can code your own window and it can be derived from any class. You window class should handle the WM_SIZEPARENT message in the same way as the CExtTabWnd::OnSizeParent() method does. Please note, the position of the window which handles the WM_SIZEPARENT message is also dependent on its Z-order.
Even some more examples. Several dialog classes in the <span class="newgreen">ProfUIS_Controls</a> sample application use the CWnd::RepositionBars() method in order to place child control bar windows near the dialog border. The CExtPropertyGridCtrl class works like an MFC frame window: the combo box bar, a toolbar and a help tip bar inside it are repositioned using the CWnd::RepositionBars() method. All CExtGridWnd -derived classes in Prof-UIS implementing grid controls also work like MFC frames and toolbar windows created as grid children will be repositioned for occupying required space near grid window borders. Even the CExtScrollBar windows created inside the CExtGridWnd window are moved to required scrollbar locations near grid borders using the WM_SIZEPARENT message and the CWnd::RepositionBars() method.
|
|
Offer Har
|
Jun 18, 2008 - 3:21 PM
|
I have a tab control in a dialog, and in the resource editor, the tab control width is exactly as the dialog’s width. I use anchor in my dialog (CExtNCW<CExtResizableDialog> ) so that the width of the tab will stay with the dialog’s width:
AddAnchor(m_ctrlTab, __RDA_KEEP, __RDA_XY); I still get a 2 pixel gap on the right side of the tab control. You can see it clearly in the images below:
|
|
Offer Har
|
Jun 18, 2008 - 10:57 AM
|
I have a simple MFC dialog based that I derived from CExtNCW<CExtResizableDialog> The system menu (of the application icon in the top-left corner), is not displayed for left-click, only with right-click. Is this on purpose? If not can it be fixed to act like all other applications? Thanks, Ron.
|
|
Offer Har
|
Jun 22, 2008 - 3:20 PM
|
Thanks, please send. One thing i noticed in the linked application is that all themes that are not office related, the corners of the application, which are rounded, are completed by to a black square - please check if this is a new bug in this application, or something ’dragged’ from 2.83
|
|
Technical Support
|
Jun 24, 2008 - 4:40 AM
|
Yes, we confirm that sometimes the window region is not re-computed by theme API when switched from a paint manager with Prof-UIS based skinned window non client areas to a simple paint manager. We will check this.
|
|
Technical Support
|
Jun 22, 2008 - 1:29 PM
|
Thank you for reporting this issue. It is now:
TestWindowMenuFix.zip
We can provide you with the udapte on your request.
|
|
Offer Har
|
Jun 18, 2008 - 10:50 AM
|
I have a grid, and I want that when the user ends the in-place edit with an enrer key press, the focus will move to the cell below the one he finished edit. How can this be done? Thanks, Ron.
|
|
Technical Support
|
Jun 19, 2008 - 5:32 AM
|
There is a similar functionality for arrow keys. You can turned it on by applying __EGWS_BSE_WALK to your grid. But if you need to make it work for the VK_RETURN key, you should implement it yourself. Please take a look at the CExtGridInplaceEdit::WindowProc() method and analyze the following code snippet. It implements moving to the next cell when the arrow key is pressed. if( bTranslate )
{
LRESULT lResult = 0L;
HWND hWndParent = GetParent()->GetSafeHwnd();
if( hWndParent != NULL )
{
HWND hWndOwn = m_hWnd;
HWND hWndGrid = m_wndGrid.m_hWnd;
CExtGridWnd * pWndGrid = &m_wndGrid;
_DoEndEdit( true );
lResult = ::SendMessage(hWndParent,WM_KEYDOWN,wParam,lParam);
if( ::IsWindow(hWndGrid)
&& ( ! ::IsWindow(hWndOwn) )
&& CWnd::FromHandlePermanent(hWndGrid) == pWndGrid
)
{
ASSERT_VALID( pWndGrid );
pWndGrid->EditCell();
}
}
return lResult;
} // if( bTranslate ) Then analyze the code after the following line: case VK_RETURN: It implements the behavior when the Return key is pressed. So what you need to do is to declare a CExtGridInplaceEdit derived class. In it, override the WindowProc virtual method and add a handler for the VK_RETURN button like for the arrow keys. Then override the CExtGridCellString::OnInplaceControlCreate virtual method and create your inplace control there.
|
|
Offer Har
|
Jun 18, 2008 - 10:43 AM
|
I have a grid with 4 rows visible, and 5 rows in total. The height of the grid is set so that exactly 4 rows are displayed. When rows 1-4 are displayed, and I click on row 4, the grid scroll down to show row 5, which it should not. I found that this happens if I show exactly 4 row, if I add even one row of pixel below the 4th row, it does not jump, as you can see in this zoomed in screen-shot. Can you please make it more precise to the pixel level? Thanks, Ron.
|
|
Mitsuhiko Yamada
|
Jun 18, 2008 - 3:30 AM
|
Dear Support I want to stick CMyWnd (class CMyWnd: public CExtNCSB <CWnd>) on CExtControlBar.
CExtControlBar crashes in Focus.
Some kind of container such as CExtTabPageContainerWnd is necessary.
Is not there any good method? Thanks
|
|
Technical Support
|
Jun 18, 2008 - 3:03 PM
|
We suppose you have a m_wndBar control bar and a m_wndInBarEdit scrollable window in your main frame class: class CMainFrame : . . .
{
. . .
CExtControlBar m_wndBar;
CExtEdit m_wndInBarEdit;
. . . You should do the following two steps in order to skin the scroll bars of the m_wndInBarEdit window: 1) Apply the CExtNCSB template class: CExtNCSB < CExtEdit > m_wndInBarEdit;
2) Put the following code into the constructor of main frame: CMainFrame::CMainFrame()
: m_wndInBarEdit( true, true ) // THIS LINE WAS ADDED
{
. . .
|
|
Offer Har
|
Jun 17, 2008 - 12:40 PM
|
I reported this a while ago, if you have a combo-box cell with colored items, and you do this: 1) Select and Item. 2) Click on another window, so the grid will lose focus. The item in the cell is not colored - it is black. If you leave the focus within the grid it is colored correctly.
|
|
Technical Support
|
Jun 19, 2008 - 5:38 AM
|
Itās not completely clear how to reproduce this bug. Would you send us some screenshots? Please note the difference between the two cases is that in first case the cell doesnāt lose focus. In the second case the focus moves to the other cell. So the coloring modes work in the different ways.
|
|
Offer Har
|
Jun 24, 2008 - 9:52 AM
|
Can you please confirm this bug?
|
|
Offer Har
|
Jun 19, 2008 - 5:55 AM
|
Dear Support, If the grid has focus or not, the color of the cells should remain the same. This is a bug that I reported a while ago. Let me explain again: 1) Create a dialog with a grid and an button (don’t implement any handler to the button - this is dummy button). 2) Create a CExtGridCellComboBox . 3) Add items to it, each one with a different color using SetItemTextColor . 4) Run the application 5) Select an item in the cell’s combo-box drop list (the colored item should appear in the cell) 6) click on the dummy button. What you will see is that the combo-box lost its color. if you don’t do step 6, the color remains. The bug is when the grid loses its focus, and the focus cell is a cell mentioned.
|
|
Offer Har
|
Jun 17, 2008 - 9:58 AM
|
I need to have tick marks like in standard slider - how can these be added to the CExtGridCellInplaceSlider cell? Thanks, Ron.
|
|
Technical Support
|
Jun 20, 2008 - 4:38 AM
|
We tried to repaint the standard slider common control some time ago using its custom painting features and we found that itās does not support tick mark custom painting. Besides tick marks in it can be displayed as some set of lines which is not related to the slider range. This is always true if the width of a horizontal slider in pixels is much less than the scrollable range. Painting real tick marks using sub-pixel graphic effects may potentially produce gray solid line instead of tick marks. That is we always prefer a slider without tick marks. Itās possible to implement smarter tick marks even with optimally displayed labels like in the chart control in the following test project:http://www.prof-uis.com/download/forums/TestGraph.zipBut such smart tick marks will look heavy near the slider control or slider grid cell.
|
|
Offer Har
|
Jun 21, 2008 - 9:43 AM
|
1) The reason ticks are in sliders, is that a lot of times there are special values in sliders. I must have a tick in the center at least - so that I can set back the value to the default. Can you implement something like "double-click returns to default" feature? 2) The link in the post leads to an error page - please check.
|
|
Technical Support
|
Jun 23, 2008 - 3:46 AM
|
1) Please search for "Second: " in the source code of the ProfUIS_Controls sample so you can find the following code in PageGrid.cpp: else if( nRowNo == 1 )
{
pCell->TextSet( _T("Second: ") );
} Modify it in this way: else if( nRowNo == 1 )
{
pCell->TextSet( _T("Second: ") );
pCell->ScrollTotalRangeSet( 6 ); // 1) add this line
pCell->ScrollPosSet( 3 ); // 2) add this line
} Compile and run the sample, select the Grid dialog page, click on the Inplace Slider hyperlink in the rightmost column with hyperlinks to display a column with inplace slider grid cells. Now you can see a slider cell in the second grid row. This cell has the "Second: " label. Please try this slider grid cell and let us know what you think about the behavior of its thumb button. Of course, this is not the same as sticking to some single position at center. But if you donāt need detailed values in your slider cells, then you may choose this solution. 2) Sorry. The correct link is http://www.prof-uis.com/download/forums/TestGraph.zip
|
|
Offer Har
|
Jun 24, 2008 - 10:03 AM
|
Regarding 2 - Cannot build it - I get this errors (I build it in 2005, don’t have VC6):
1>CVTRES : fatal error CVT1100: duplicate resource. type:MANIFEST, name:1, language:0x0409
1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
|
|
Offer Har
|
Jun 24, 2008 - 9:58 AM
|
The concept you suggested in 1 is not good enough. I must have a simple way to move the slider back to the center of the slider. What you suggest, which is making it have less values it not good enough. My slider is a dimmer, which makes the display lighter or darker, so it must have a high resolution, but must have some way of making the dimmer go back to the default light.
|
|
Offer Har
|
Jun 17, 2008 - 8:34 AM
|
I have a docked bar, double-click on its title bar floats it as it should. When I double-click again on the title bar it should dock back to where it was docked before, and it doesn’t. Please fix. Thanks, Ron.
|
|
Michele Cillo
|
Jun 16, 2008 - 12:19 PM
|
I’ve found an annoying bug in CExtResizableDialog. I have a CExtResizableDialog with some controls. One of this control is a button. If I click on this button a new CExtResizableDialog appears (using CExtResizableDialog::DoModal()). If I close this second CExtResizableDialog, I expect the clicked button focused, instead the first control (in tab order) of the first dialog is focused. I have a little test project if you need it. Thanks.
|
|
Technical Support
|
Jun 23, 2008 - 12:52 PM
|
We fixed this problem finally. You can drop us e-mail to the support mail box at this web site so we will provide you with the source code update.
|
|
Michele Cillo
|
Jun 27, 2008 - 6:21 AM
|
Sorry for the delay, but I was offiste. I immediately send you an email to tech support address. Thanks for the great work.
|
|
Technical Support
|
Jun 22, 2008 - 1:24 PM
|
We just want to notify you that this issue is confirmed and we are working on it.
|
|
Offer Har
|
Jun 16, 2008 - 11:54 AM
|
Is there a way to hide a sub-tree (not to remove it permanently with ItemRemove ) I need a sub-tree to be displayed according to certain rules, and to be hidden if other conditions are met. Thanks, Ron.
|
|
Technical Support
|
Jun 16, 2008 - 1:55 PM
|
It seems the CExtTreeGridWnd::ItemHide() method is what you are looking for.
|
|
Offer Har
|
Jun 16, 2008 - 5:42 PM
|
|
|
Offer Har
|
Jun 16, 2008 - 11:52 AM
|
Dear Support, In previous versions, when switching views from the tabs of the CExtTabMdiWnd , the WM_SETFOCUS was called for the view receiving focus and the view losing focus. In 2.83 the WM_SETFOCUS is not called (If I restore two views, and switch from one to the other by clicking on their title, the WM_SETFOCUS is called as before - the problem is only in CExtTabMdiWnd ’s views switching) Please rectify, as this is a core requirement for out applications, and a lot of our job is done in this function. Thanks, Ron.
|
|
Offer Har
|
Jun 17, 2008 - 11:29 AM
|
More details on this bug: After the main frame loses focus, and regain it, it start to work: - If I just launch the application, open two views, and click the tabs, on focus events are not caught in the view.
- I click on another application, and then com back to my Prof-UIS based application,
- Now, when clicking the tabs the focus event is received in the view.
Can you please check this bug? this is preventing us from moving to 2.83 Thanks, Ron.
|
|
Offer Har
|
Jun 24, 2008 - 10:04 AM
|
Hello - can you please confirm this bug?
|
|
Offer Har
|
Jun 16, 2008 - 10:33 AM
|
In 2.82 and before, the caption bar of floating bars in black theme was orange for the focused one, and gray to all others. In 2.83 all of them are orange. The only time the non-focused become gray is when the main frame loses focus (click on another application, all become gray but the focus one, which remains orange) Is this a bug? Regards, Ron.
|
|
Technical Support
|
Jun 16, 2008 - 1:58 PM
|
Fixed, please update the source code for the following method: void CExtControlBar::OnUpdateCmdUI(
CFrameWnd * pTarget,
BOOL bDisableIfNoHndler
)
{
if( m_bPresubclassDialogMode || m_bDragging || m_bRowRecalcing || m_bRowResizing || (CExtControlBar::_DraggingGetBar() != NULL) )
return;
pTarget; bDisableIfNoHndler;
if( ( GetStyle() & WS_VISIBLE ) == 0 && ( ! m_bUseInvisibleCmdUI ) )
return;
CPoint ptScreen;
if( ! ::GetCursorPos( &ptScreen ) )
return;
bool bNeedRepaint = false;
UINT nHT = NcButtons_HitTest( ptScreen );
if( nHT == HTCLIENT )
{
if( m_bNcAreaBtnTracking )
bNeedRepaint = true;
m_bNcAreaBtnTracking = false;
if( ( ! CExtPopupMenuWnd::IsKeyPressed( VK_LBUTTON ) ) && GetSafeHwnd() != NULL && ::GetCapture() == m_hWnd )
::ReleaseCapture();
}
else
{
if( ! m_bNcAreaBtnTracking )
bNeedRepaint = true;
m_bNcAreaBtnTracking = true;
}
HWND hTmpWndFocus = ::GetFocus();
bool bWindowActiveOldVal = m_bWindowActive;
m_bWindowActive = ( hTmpWndFocus != NULL && ( GetSafeHwnd() == hTmpWndFocus || ::IsChild( GetSafeHwnd(), hTmpWndFocus ) ) );
if( bWindowActiveOldVal != m_bWindowActive )
bNeedRepaint = true;
if( bNeedRepaint )
{
SendMessage( WM_NCPAINT );
GetParent()->SendMessage( WM_NCPAINT );
if( IsVisible() )
{
CFrameWnd * pFrame = GetParentFrame();
if( pFrame->IsKindOf( RUNTIME_CLASS(CExtMiniDockFrameWnd) ) )
pFrame->SendMessage( WM_NCPAINT );
}
}
}
|
|
Offer Har
|
Jun 16, 2008 - 8:50 AM
|
Dear Support, There is a repeated problem in 2.83 regarding the line at the end of the right most column when the right most column fits all the way to the right of the grid, using ExtentPercentSet, this separator line should not be visible. When I reported this in the past, you removed this last separator line completely, which was wrong, as for other grids this line should be there. What I suggest that there will be some API of style weather to dispplay or hide the separator line on the last grid column’s row header, so that a user will be able to remove it if not needed. What do you say? Thanks, Ron.
|
|
Offer Har
|
Jun 15, 2008 - 8:26 PM
|
This is an open issue from last year - when a tab container contains dialogs, there is no frame or other method that links the tab control to the contained pages, which does not look good. You said you will find a solution to this problem (in normal windows, there is a frame around the contained pages that links the tab control and the contained page) Any progress on this problem? Any plans to fix this? Thanks, Ron.
|
|
Offer Har
|
Jun 16, 2008 - 10:19 AM
|
OK - sound like a good solution... Will it make it way to 2.84? Thanks, Ron.
|
|
Technical Support
|
Jun 16, 2008 - 10:13 AM
|
We can see only one solution for this issue: reserve some space around page windows, paint it consistently with tab border and, optionally, repaint the background of page windows.
|
|
Neville Franks
|
Jun 15, 2008 - 5:17 PM
|
I would like to request a new Tab control style be added which enables the mouse wheel to scroll Tabs in CExtTabWnd and dervied classes, such as CExtTabMdiOneNoteWnd. Mozilla Firefox V2 has this capability and has been requested by our users. Thanks, Neville http://blog.surfulater.com
|
|
Offer Har
|
Jun 15, 2008 - 7:46 AM
|
When adding CExtNCW to my child window in an MDI application. the tile vertical, tile horizontal and cascade are ignored. If I remove this template, they work... This is in the official 2.83 release.
|
|
Offer Har
|
Jun 16, 2008 - 10:20 AM
|
Nope - nothing but the default MFC stuff there. As I said, when removing the template all works well, with the template nothing works, so it is for sure something with the new code. Is there are tweaks from your side I should be aware of?
|
|
Technical Support
|
Jun 16, 2008 - 10:14 AM
|
We tested all the standard MDI commands with our MDI sample applications. Do you use any MDI interface extensions based on any hooks?
|
|
Offer Har
|
Jul 2, 2008 - 6:16 AM
|
I saw other complains on this feature. Is there any chance that you will release a fix for this for 2.83?
|
|
Technical Support
|
Jul 2, 2008 - 12:59 PM
|
If the problem cannot be reproduced, then it cannot be solved. Could you help us reproduce this problem in some way?
|
|
Offer Har
|
Jul 2, 2008 - 8:21 PM
|
I will check it with the MDI sample applications, and send you a sample application.
|
|
Offer Har
|
Jun 15, 2008 - 7:41 AM
|
The separator lines in the tab were added, but they are not in the right place - they should be moved a couple of pixels to the right, as they cut the gray area under the tab: This is in the official 2.83 release.
|
|
Technical Support
|
Jun 16, 2008 - 10:13 AM
|
Thank you for reporting this issue. It’s noticeable only when the Obsidian style is applied where the separator text has not the same color as the tab margin text. The separator also has an incorrect position in the Blue and Gray themes but these themes have the tab border color same as the separator color and incorrect separator intersection with the tab is not visible. You can fix it by updating the CExtPaintManagerOffice2007_Impl::PaintTabItem() method: void CExtPaintManagerOffice2007_Impl::PaintTabItem(
CDC & dc, CRect & rcTabItemsArea, bool bTopLeft, bool bHorz, bool bSelected, bool bCenteredText,
bool bGroupedMode, bool bInGroupActive, bool bInvertedVerticalMode, const CRect & rcEntireItem,
CSize sizeTextMeasured, CFont * pFont, __EXT_MFC_SAFE_LPCTSTR sText, CExtCmdIcon * pIcon,
CObject * pHelperSrc, LPARAM lParam, COLORREF clrForceText, COLORREF clrForceTabBk,
COLORREF clrForceTabBorderLT, COLORREF clrForceTabBorderRB, COLORREF clrForceTabSeparator
)
{
ASSERT_VALID( this );
ASSERT( dc.GetSafeHdc() != NULL );
if( IsHighContrast() )
{
CExtPaintManagerXP::PaintTabItem( dc, rcTabItemsArea, bTopLeft, bHorz, bSelected, bCenteredText,
bGroupedMode, bInGroupActive, bInvertedVerticalMode, rcEntireItem, sizeTextMeasured, pFont,
sText, pIcon, pHelperSrc, lParam, clrForceText, clrForceTabBk, clrForceTabBorderLT,
clrForceTabBorderRB, clrForceTabSeparator );
return;
}
if( pHelperSrc == NULL
|| ( (! pHelperSrc->IsKindOf( RUNTIME_CLASS( CExtTabWnd ) ) )
&& (! pHelperSrc->IsKindOf( RUNTIME_CLASS( CExtBarButton ) ) )
)
|| IsHighContrast()
)
{
CExtPaintManager::PaintTabItem( dc, rcTabItemsArea, bTopLeft, bHorz, bSelected, bCenteredText,
bGroupedMode, bInGroupActive, bInvertedVerticalMode, rcEntireItem, sizeTextMeasured, pFont,
sText, pIcon, pHelperSrc, lParam, clrForceText, clrForceTabBk, clrForceTabBorderLT,
clrForceTabBorderRB, clrForceTabSeparator );
return;
}
CExtCmdIcon * pIconTabItemCloseButton = NULL;
CExtCmdIcon::e_paint_type_t ePaintStateITICB = (CExtCmdIcon::e_paint_type_t) CExtCmdIcon::__PAINT_INVISIBLE;
CRect rcTabItemCloseButton( 0, 0, 0, 0 );
CExtBarButton * pTBB = NULL;
CExtTabWnd * pTabs = NULL;
CExtTabWnd::TAB_ITEM_INFO * pTII = NULL;
if( pHelperSrc != NULL )
{
pTabs = DYNAMIC_DOWNCAST( CExtTabWnd, pHelperSrc );
if( pTabs != NULL )
{
ASSERT_VALID( pTabs );
pTII = pTabs->ItemGet( LONG( lParam ) );
ASSERT( pTII != NULL );
ASSERT_VALID( pTII );
pIconTabItemCloseButton = pTabs->OnTabWndQueryItemCloseButtonShape( pTII );
if( pIconTabItemCloseButton != NULL )
{
rcTabItemCloseButton = pTII->CloseButtonRectGet();
ePaintStateITICB = (CExtCmdIcon::e_paint_type_t) pTabs->OnTabWndQueryItemCloseButtonPaintState( pTII );
}
}
else
{
pTBB = DYNAMIC_DOWNCAST( CExtBarButton, pHelperSrc );
#ifdef _DEBUG
if( pTBB != NULL )
{
ASSERT_VALID( pTBB );
}
#endif
}
}
LPCTSTR _sText = LPCTSTR(sText);
bool bDrawIcon = ( pIcon != NULL && (! pIcon->IsEmpty() )
&& ( pTabs == NULL || (pTabs->GetTabWndStyle()&__ETWS_HIDE_ICONS) == 0 )
);
if( bGroupedMode )
bSelected = false;
bool bEnabled = true;
if( pTII != NULL )
bEnabled = pTII->EnabledGet();
else if( pTBB != NULL )
bEnabled = pTBB->IsEnabled();
bool bHover = false, bPressed = false;
INT nIdxTabShape = m_nIdxTabShapeDisabled;
if( pTabs != NULL && pTabs->ItemGet( LONG(lParam) )->EnabledGet() )
{
bHover = ( pTabs->GetHoverTrackingItem() == lParam ) ? true : false;
bPressed = ( pTabs->GetPushedTrackingItem() == lParam ) ? true : false;
}
else if( pTBB != NULL )
{
bHover = pTBB->IsHover();
bPressed = pTBB->IsPressed();
}
#if (!defined __EXT_MFC_NO_DYNAMIC_BAR_SITE)
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
bool bDetectedDynTPC = false;
#endif
if( pTII != NULL )
{
CObject * pObject = pTII->EventProviderGet();
if( pObject != NULL )
{
CExtDynamicControlBar * pBar = DYNAMIC_DOWNCAST( CExtDynamicControlBar, pObject );
if( pBar != NULL )
{
bool bFlashCaptionHighlightedState = false;
if( pBar->FlashCaptionIsInProgress( &bFlashCaptionHighlightedState ) )
{
if( bFlashCaptionHighlightedState )
{
clrForceText = pBar->m_clrFlashCaptionText;
clrForceTabBk = pBar->m_clrFlashCaptionBackground;
bSelected = true;
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
bDetectedDynTPC = true;
#endif
}
}
}
}
}
#endif
COLORREF clrText = QueryObjectTextColor( dc, bEnabled, false, bHover, bPressed, pHelperSrc, lParam );
if( clrText == COLORREF(-1L) )
clrText = bEnabled ? m_clrTabTextNormal : GetColor( CLR_TEXT_DISABLED, pHelperSrc, lParam );
nIdxTabShape = m_nIdxTabShapeNormal;
if( bSelected )
{
if( bEnabled )
clrText = m_clrTabTextSelected;
nIdxTabShape = m_nIdxTabShapeSelected;
if( bHover && (!bPressed) )
nIdxTabShape = m_nIdxTabShapeSelectedHover;
}
else
{
if( bPressed )
nIdxTabShape = m_nIdxTabShapePressed;
else if( bHover )
nIdxTabShape = m_nIdxTabShapeHover;
}
e_TabShapeOrientationIndex_t eTSOI = __ETSOI_TOP;
if( bTopLeft )
{
if( bHorz )
eTSOI = __ETSOI_TOP;
else
eTSOI = __ETSOI_LEFT;
}
else
{
if( bHorz )
eTSOI = __ETSOI_BOTTOM;
else
eTSOI = __ETSOI_RIGHT;
}
if( bGroupedMode )
{
switch( eTSOI )
{
case __ETSOI_TOP: eTSOI = __ETSOI_BOTTOM; break;
case __ETSOI_BOTTOM: eTSOI = __ETSOI_TOP; break;
case __ETSOI_LEFT: eTSOI = __ETSOI_RIGHT; break;
case __ETSOI_RIGHT: eTSOI = __ETSOI_LEFT; break;
}
}
COLORREF clrColorizeTabShape = COLORREF(-1L);
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
if( pHelperSrc != NULL
&& clrForceTabBk != COLORREF(-1L)
&& ( bDetectedDynTPC
|| pHelperSrc->IsKindOf( RUNTIME_CLASS( CExtDynTabWnd ) )
|| pHelperSrc->IsKindOf( RUNTIME_CLASS( CExtDynAutoHideArea ) )
)
)
{
if( clrForceText != COLORREF(-1L) )
clrText = clrForceText;
clrColorizeTabShape = clrForceTabBk;
}
#endif
#if (!defined __EXT_MFC_NO_TABMDI_CTRL)
if( pHelperSrc != NULL
&& clrForceTabBk != COLORREF(-1L)
&& pHelperSrc->IsKindOf( RUNTIME_CLASS( CExtTabWnd ) )
&& ((CExtTabWnd*)pHelperSrc)->_IsMdiTabCtrl()
)
{
if( clrForceText != COLORREF(-1L) )
clrText = clrForceText;
clrColorizeTabShape = clrForceTabBk;
}
#endif
if( nIdxTabShape >= 0 )
{
bool bSelTrackingMode = false;
#if (!defined __EXT_MFC_NO_RIBBON_BAR)
if( pTBB != NULL
&& pTBB->IsKindOf( RUNTIME_CLASS( CExtRibbonButtonTabPage ) )
&& ((CExtRibbonButtonTabPage*)pTBB)->IsSelectedRibbonPage()
)
{
CExtToolControlBar * pToolBar = pTBB->GetBar();
if( pToolBar != NULL )
{
CExtMenuControlBar * pMenuBar = DYNAMIC_DOWNCAST( CExtMenuControlBar, pToolBar );
if( pMenuBar != NULL
&& pMenuBar->IsMenuBarTracking()
)
{
int nFlatTrackingIndex = pMenuBar->_FlatTrackingIndexGet();
if( nFlatTrackingIndex >= 0 )
{
int nIndexOfTBB = pMenuBar->_GetIndexOf( pTBB );
if( nFlatTrackingIndex == nIndexOfTBB )
{
if(! m_arrBmpTabShapeSelArea[0].IsEmpty() )
bSelTrackingMode = true;
else
nIdxTabShape = m_nIdxTabShapeHover;
}
}
}
}
}
#endif
const CExtBitmap & _bmpTabShape =
bSelTrackingMode ? m_arrBmpTabShapeSelArea[ int(eTSOI) ] : m_arrBmpTabShapeNormal[ int(eTSOI) ] ;
if( ! _bmpTabShape.IsEmpty() )
{
CRect rcPadding = m_arrRectTabShapePadding[ int(eTSOI) ];
CRect rcSrc( 0, 0, m_arrSizeTabShape[int(eTSOI)].cx, m_arrSizeTabShape[int(eTSOI)].cy );
rcSrc.OffsetRect(
0,
m_arrSizeTabShape[int(eTSOI)].cy * nIdxTabShape
);
CRect rcPaintTabShape = rcEntireItem;
switch( eTSOI )
{
case __ETSOI_TOP:
case __ETSOI_BOTTOM: rcPaintTabShape.right --; break;
case __ETSOI_LEFT:
case __ETSOI_RIGHT: rcPaintTabShape.bottom --; break;
}
if( clrColorizeTabShape != COLORREF(-1L) )
{
CExtBitmap _bmpTabShape2 = _bmpTabShape;
_bmpTabShape2.Make32();
_bmpTabShape2.AdjustHLS( COLORREF(-1L), COLORREF(-1L), 0.0, -0.5, -1.0 );
_bmpTabShape2.MakeMono( clrColorizeTabShape );
_bmpTabShape2.AlphaBlendSkinParts( dc.m_hDC, rcPaintTabShape, rcSrc, rcPadding,
CExtBitmap::__EDM_STRETCH, true, true );
}
else
_bmpTabShape.AlphaBlendSkinParts( dc.m_hDC, rcPaintTabShape, rcSrc, rcPadding,
CExtBitmap::__EDM_STRETCH, true, true );
}
}
CRect rcEntireItemX = rcEntireItem;
rcEntireItemX.DeflateRect( 3, 3 );
CExtPaintManager::stat_PaintTabItemImpl( dc, rcTabItemsArea, bTopLeft, bHorz, bSelected, bEnabled,
bCenteredText, bGroupedMode, bInGroupActive, bInvertedVerticalMode, bDrawIcon, rcEntireItemX,
sizeTextMeasured, pFont, _sText, pIcon, pIconTabItemCloseButton, INT(ePaintStateITICB),
rcTabItemCloseButton, clrText, COLORREF(-1L), COLORREF(-1L), COLORREF(-1L), COLORREF(-1L),
( pTBB != NULL ) ? false : true, pHelperSrc );
const CExtBitmap & _bmpTabSeparator = m_arrBmpTabSeparator[ int(eTSOI) ];
if( ! _bmpTabSeparator.IsEmpty() )
{
CRect rcPaintSeparator = rcEntireItem;
CRect rcPadding = m_arrRectTabSeparatorPadding[ int(eTSOI) ];
CRect rcSrc( 0, 0, m_arrSizeTabSeparator[int(eTSOI)].cx, m_arrSizeTabSeparator[int(eTSOI)].cy );
e_paint_manager_name_t ePMN = OnQueryPaintManagerName();
switch( eTSOI )
{
case __ETSOI_TOP:
rcPaintSeparator.left = rcPaintSeparator.right - m_arrSizeTabSeparator[int(eTSOI)].cx;
rcPaintSeparator.bottom --;
if( ePMN == Office2007_R2_Obsidian )
rcPaintSeparator.bottom -= 2;
break;
case __ETSOI_BOTTOM:
rcPaintSeparator.left = rcPaintSeparator.right - m_arrSizeTabSeparator[int(eTSOI)].cx;
rcPaintSeparator.top ++;
break;
case __ETSOI_LEFT:
rcPaintSeparator.top = rcPaintSeparator.bottom - m_arrSizeTabSeparator[int(eTSOI)].cy;
rcPaintSeparator.right --;
break;
case __ETSOI_RIGHT:
rcPaintSeparator.top = rcPaintSeparator.bottom - m_arrSizeTabSeparator[int(eTSOI)].cy;
rcPaintSeparator.left ++;
break;
}
BYTE nSCA = BYTE(0x0FF);
#if (!defined __EXT_MFC_NO_RIBBON_BAR)
if( pTBB != NULL )
{
CExtRibbonButtonTabPage * pRibbonButtonTabPage =
DYNAMIC_DOWNCAST( CExtRibbonButtonTabPage, pTBB );
if( pRibbonButtonTabPage != NULL )
nSCA = pRibbonButtonTabPage->Get2007SeparatorAlpha();
}
#endif
_bmpTabSeparator.AlphaBlendSkinParts( dc.m_hDC, rcPaintSeparator, rcSrc, rcPadding,
CExtBitmap::__EDM_STRETCH, true, true, nSCA );
}
}
|
|
Offer Har
|
Jun 15, 2008 - 7:04 AM
|
Hi, I installed 2.83, and want to merge cells in my tree grid - and it doesn’t work. This is what I do: I create a new node in the tree, get its HTREEITEM and call this line (I have a two columns tree):
GridCellJoinSet(CSize(2,1), 0, ItemGetVisibleIndexOf(hti)); What happens is very weird - it seems that the two cells in the row that I joined are being written one on top of the other... Note that the two cells are of the type CExtGridCellString , the left one has a text value, and the right one is empty, what I wanted was that when the left column becomes narrow, the text will flow to the right column’s cell. Is this a bug? is this feature available in tree grid? If not when will it be available? I am sending you a clip via mail to show you to problematic behavior.
|
|
Offer Har
|
Jun 16, 2008 - 10:17 AM
|
Dear Support, I am using it in one row only (as you can see above: CSize(2,1) ) and still there is a problem in tree grid - I sent you a video clip shwing how it behaves. We really need this feature in tree grid, as we need something similar to what you implelemted in property grid, when the category header occupies the whole width. Thanks, Ron.
|
|
Technical Support
|
Jun 16, 2008 - 10:08 AM
|
The cell merging feature has just appeared v.2.83. We tested it with the CExtGridWnd control. We can also make it working with CExtTreeGridWnd and non-grouped CExtReportGridWnd controls. In the case of tree grid, the user is responsible for merging cells in one row only or in scope of rows which have no child rows. But at present the merging feature is developed for the CExtGridWnd control only.
|
|
Offer Har
|
Jun 23, 2008 - 5:22 PM
|
Hello there... any idea why this bug exist in tree grid? any change to patch it on 2.83? Please reply...
|
|
Offer Har
|
Jun 19, 2008 - 12:39 PM
|
Any ideas why it doesn’t work in a tree grid control with you above mentioned constrains?
|
|
Ulrich Heinicke
|
Jun 14, 2008 - 2:24 PM
|
There is a bug into ExtTabWnd. I insert into your example ProfUIS_Controls into the file PageTapWindow.cpp the following line: CPageTabWindow::demo_items_data_t CPageTabWindow::g_ItemsData[] =
{
{ _T("&DevStudio"), true },
{ _T("4"), true },
now look at the screen shots: you can see that the text is not displayed for the second tab correctly. I think the rcEntireItem is to small. Please tell me where you calculate the rcEntireItem, so i can solve the problem. It’s very urgent for me. Ulrich
|
|