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 |
|
Offer Har
|
Mar 25, 2009 - 9:18 AM
|
Dear Support, I have a dialog with CExtDateTimeWnd . I need the dialog to get notified when the time in the control is changed. I could not find what is the message it sends to the dialog when the control content has changed. Thanks, Ron.
|
|
Technical Support
|
Mar 25, 2009 - 2:18 PM
|
Please take a look at the CPageDateTimeDuration class in the ProfUIS_Controls sample application. The CExtDateTimeWnd::g_nMsgChangingNotification registered message is handled in the CPageDateTimeDuration::OnSelChangedDateTime method which writes messages to the log editor window at the bottom side of the Date & Time dialog page when the date or time files in the date time control are changed.
|
|
tera tera
|
Mar 25, 2009 - 1:34 AM
|
I ask for advice.
In reference to CExtColorPaletteWnd, I think about making with a variable button.
|
|
Technical Support
|
Mar 25, 2009 - 11:10 AM
|
The CExtColorPaletteWnd control uses items of equal sizes. You should use the toolbar control instead. First of all please create your own CExtToolControlBar -derived class which implements the following virtual methods:
virtual CExtBarContentExpandButton * OnCreateBarRightBtn()
{
ASSERT_VALID( this );
return NULL; // We do not need the chevron button in your toolbar:
}
virtual bool _GetFullRowMode() const { return true; }
virtual bool OnQueryMultiRowLayout() const { return true; }
virtual bool IsBarWithGripper( bool * pbGripperAtTop = NULL, bool * pbTextOnGripper = NULL ) const { pbGripperAtTop; pbTextOnGripper; return false; }
Then please create your CExtToolControlBar -based control inside tab page container instead of the CExtColorPaletteWnd control. Then you can initialize toolbar buttons instead of the color palette items. The toolbar control supports buttons of variable sizes.
|
|
tera tera
|
Mar 25, 2009 - 6:43 PM
|
Hello. I want to start a new line from the very last button of the group button in a line.
In ToolMenu, will such a thing be possible? In addition, I do not understand the registration of the button.
Do you perform LoadMenu?
Or do you make ExtBarButton every 1 button?
|
|
Technical Support
|
Mar 26, 2009 - 6:04 AM
|
The multi row layout toolbars we advised you in our previous answer do not support user defined row wrapping. The multi row layout toolbars are toolbars which are using layout and behavior of menu bar. So, you need another solution. Fortunately it exists and it’s also based on the toolbar control. Please take a look at the CMainFrame::m_wndPalette window in the DRAWCLI sample application. This is the dockable CExtToolControlBar toolbar control switched into the palette mode. The toolbars in palette mode support independent button layout in horizontally docked, vertically docked and floating states. In each state, the layout of buttons in such palette toolbar is organized into rows. The last button in each row is marked with the wrap flag. Here is how the toolbar control in palette mode is initialized in the CMainFrame::OnCreate() method of the DRAWCLI sample application:
m_wndPalette.m_bPaletteMode = true;
if( !m_wndPalette.Create(
NULL,
this,
ID_VIEW_PALETTE
)
||
!m_wndPalette.LoadToolBar(IDR_TOOLBAR_HELPER_ICONS)
)
{
TRACE0("Failed to create m_wndPalette toolbar\n");
return -1; // fail to create
}
m_wndPalette.InsertButton();
nBtnIdx = m_wndPalette.GetButtonsCount();
m_pBtnColorFillP =
new CExtBarColorButton(
&m_wndPalette,
ID_OBJECT_FILLCOLOR, 0, COLORREF(-1), RGB(0,0,0),
ID_OBJECT_FILLCOLOR, true, true,
(LPCTSTR)sNoFill, NULL,
CExtBarColorButton::__DIT_CHAR_2007
);
m_pBtnColorFillP->SetSeparatedDropDown();
VERIFY(
m_wndPalette.InsertSpecButton(
nBtnIdx,
m_pBtnColorFillP,
FALSE
)
);
nBtnIdx++;
m_pBtnColorOutlineP =
new CExtBarColorButton(
&m_wndPalette,
ID_OBJECT_LINECOLOR, 0, COLORREF(-1), RGB(0,0,0),
ID_OBJECT_LINECOLOR, true, true,
(LPCTSTR)sNoOutline, NULL,
CExtBarColorButton::__DIT_FRAME
);
VERIFY(
m_wndPalette.InsertSpecButton(
nBtnIdx,
m_pBtnColorOutlineP,
FALSE
)
);
m_wndPalette.GetButton( 3 )->SetWrap( CExtBarButton::__EVT_HORZ );
m_wndPalette.GetButton( 8 )->SetWrap( CExtBarButton::__EVT_HORZ );
m_wndPalette.GetButton( 14 )->SetWrap( CExtBarButton::__EVT_HORZ );
m_wndPalette.GetButton( 3 )->SetWrap( CExtBarButton::__EVT_VERT );
m_wndPalette.GetButton( 6 )->SetWrap( CExtBarButton::__EVT_VERT );
m_wndPalette.GetButton( 9 )->SetWrap( CExtBarButton::__EVT_VERT );
m_wndPalette.GetButton( 12 )->SetWrap( CExtBarButton::__EVT_VERT );
m_wndPalette.GetButton( 14 )->SetWrap( CExtBarButton::__EVT_VERT );
m_wndPalette.GetButton( 3 )->SetWrap( CExtBarButton::__EVT_FLOAT );
m_wndPalette.GetButton( 5 )->SetWrap( CExtBarButton::__EVT_FLOAT );
m_wndPalette.GetButton( 7 )->SetWrap( CExtBarButton::__EVT_FLOAT );
m_wndPalette.GetButton( 9 )->SetWrap( CExtBarButton::__EVT_FLOAT );
m_wndPalette.GetButton( 11 )->SetWrap( CExtBarButton::__EVT_FLOAT );
m_wndPalette.GetButton( 14 )->SetWrap( CExtBarButton::__EVT_FLOAT );
You can just create a non-dockable toolbar with palette mode as a child of a resizable control bar. Even more, a toolbar control in palette mode supports separator buttons which automatically look like horizontal or vertical separators depending on the palette toolbar layout. You can see such separators in the palette mode toolbar in DRAWCLI sample application. You can use these separators to for highlighting differences between group of buttons displayed on your schematic screen shots. Please note, the toolbar buttons are based on the command identifiers registered in the command manager. So, you may need to allocate required number of command identifiers in the command manager using the g_CmdManager->CmdAllocPtr() code (the CExtCmdManager::CmdAllocPtr() method) before inserting them into your palette toolbar as palette items. The CMainFrame::m_wndPalette window in the DRAWCLI sample application is initialized via loading set of buttons from the toolbar resource. Then the set of code lines like m_wndPalette.GetButton( . . . ) -> SetWrap( . . . ) is invoked for assigning wrapping flags to toolbar buttons. You will need to initialize toolbar with buttons manually using the CExtToolControlBar::InsertButton() method and specifying pre-allocated in the command manager identifier in parameters. If you have any difficulties with this task, please let us know.
|
|
Offer Har
|
Mar 24, 2009 - 4:56 PM
|
Dear Support, In silver theme, the button in cell, if disabled or enabled they look almost the same, as you can see in the picture below. If you will zoom the picture, you will spot the differences, but in normal viewing it’s very hard to see that the button is disabled. Can you please fix it for next version. Thanks, Ron. Some are disabled, and some are not... hard to tell which is which.
|
|
Technical Support
|
Mar 25, 2009 - 6:27 AM
|
Thank you for reporting this issue. To fix it, please update the source code for the following method. void CExtGridCell::OnPaintButton(
const RECT & rcButton,
INT nButtonType, // e_button_type_t
bool bPressed,
bool bHovered,
bool bFocused,
bool bEnabled,
const CExtGridWnd & wndGrid,
CDC & dc,
LONG nVisibleColNo,
LONG nVisibleRowNo,
LONG nColNo,
LONG nRowNo,
INT nColType,
INT nRowType,
const RECT & rcCellExtra,
const RECT & rcCell,
const RECT & rcVisibleRange,
DWORD dwAreaFlags,
DWORD dwHelperPaintFlags
) const
{
ASSERT_VALID( this );
ASSERT_VALID( (&wndGrid) );
ASSERT( dc.GetSafeHdc() != NULL );
if( ! dc.RectVisible(&rcButton) )
return;
nVisibleColNo; nVisibleRowNo; nColNo; nRowNo; nColType; nRowType;
rcCellExtra; rcCell; rcVisibleRange; dwAreaFlags;
if( ! bEnabled )
bPressed = false;
if( (dwHelperPaintFlags&__EGCPF_SIMPLIFIED_RENDERING_TARGET) == 0 )
{
COLORREF clrFace = wndGrid.OnSiwGetSysColor( COLOR_3DFACE );
COLORREF clrLight = wndGrid.OnSiwGetSysColor( COLOR_3DHIGHLIGHT );
COLORREF clrShadow = CExtPaintManager::stat_HLS_Adjust( wndGrid.OnSiwGetSysColor( COLOR_3DSHADOW ) , 0.0, 0.35, 0.0 );
COLORREF clrWindow = wndGrid.OnSiwGetSysColor( COLOR_WINDOW );
COLORREF clrText = wndGrid.OnSiwGetSysColor( COLOR_BTNTEXT );
wndGrid.PmBridge_GetPM()->Grid_PaintButton(
dc, rcButton, nButtonType, bPressed, bHovered, bFocused, bEnabled,
clrFace, clrLight, clrShadow, clrWindow, clrText,
dwHelperPaintFlags, (CObject*) &wndGrid, 0L
);
return;
} // if( (dwHelperPaintFlags&__EGCPF_SIMPLIFIED_RENDERING_TARGET) == 0 )
if( (dwHelperPaintFlags&__EGCPF_NO_BUTTONS) != 0 )
return;
COLORREF clrOldBkColor = dc.GetBkColor();
COLORREF clrOldTextColor = dc.GetTextColor();
int nOldBkMode = dc.GetBkMode();
COLORREF clrFace = wndGrid.OnSiwGetSysColor( COLOR_3DFACE );
COLORREF clrLight = wndGrid.OnSiwGetSysColor( COLOR_3DHIGHLIGHT );
COLORREF clrShadow = wndGrid.OnSiwGetSysColor( COLOR_3DSHADOW );
COLORREF clrOuterLT = bPressed ? clrShadow : clrLight;
COLORREF clrOuterRB = bPressed ? clrLight : clrShadow;
CRect rc( rcButton );
CExtPaintManager::glyph_t * pGlyph = NULL;
dc.FillSolidRect( &rc, clrFace );
rc.DeflateRect( 2, 2 );
dc.Draw3dRect( &rcButton, clrOuterLT, clrOuterRB );
if( bPressed )
rc.OffsetRect( 0, 1 );
if( nButtonType == INT(__EBTT_DROPDOWN) )
{
if( (dwHelperPaintFlags&__EGCPF_NO_BUTTON_DROPDOWN_ARROW) == 0 )
pGlyph = CExtPaintManager::g_DockingCaptionGlyphs[ (INT) CExtPaintManager::__DCBT_ARROW_DOWN ];
}
else if( nButtonType == INT(__EBTT_ELLIPSIS) )
{
if( (dwHelperPaintFlags&__EGCPF_NO_BUTTON_ELLIPSIS_DOTS) == 0 )
pGlyph = CExtPaintManager::g_DockingCaptionGlyphs[ (INT) CExtPaintManager::__DCBT_ELLIPSIS ];
}
else if( nButtonType == INT(__EBTT_UPDOWN_UP) )
{
pGlyph = CExtPaintManager::g_DockingCaptionGlyphs[ (INT) CExtPaintManager::__DCBT_ARROW_SMALL_UP ];
}
else if( nButtonType == INT(__EBTT_UPDOWN_DOWN) )
{
pGlyph = CExtPaintManager::g_DockingCaptionGlyphs[ (INT) CExtPaintManager::__DCBT_ARROW_SMALL_DOWN ];
}
if( pGlyph != NULL )
{
COLORREF ColorValues[2] = { RGB(0,0,0), RGB(0,0,0), };
ColorValues[1] = bEnabled ? wndGrid.OnSiwGetSysColor( COLOR_BTNTEXT ) : clrLight;
if( ! bEnabled )
rc.OffsetRect( 1, 1 );
g_PaintManager->PaintGlyphCentered( dc, rc, *pGlyph, ColorValues );
if( ! bEnabled )
{
rc.OffsetRect( -1, -1 );
ColorValues[1] = clrShadow;
g_PaintManager->PaintGlyphCentered( dc, rc, *pGlyph, ColorValues );
} // if( ! bEnabled )
} // if( pGlyph != NULL )
dc.SetBkColor( clrOldBkColor );
dc.SetTextColor( clrOldTextColor );
dc.SetBkMode( nOldBkMode );
}
|
|
Offer Har
|
Mar 24, 2009 - 10:12 AM
|
|
|
Technical Support
|
Mar 24, 2009 - 2:27 PM
|
We have 3 issues reported by you under development: tree item hide issue (not fixed yet), fast 3 mouse clicks issue (still cannot reproduce it) and MDI crash issue (fixed).
To fix the MDI crash issue, please find the following code in the CExtMenuControlBar::OnHookWndMsg() method:
if( nMessage == WM_MDIACTIVATE
|| nMessage == WM_MDIDESTROY
|| nMessage == WM_MDINEXT
)
{
if( nMessage == WM_MDINEXT
&& IsOleIpObjActive()
)
{
lResult = 0;
return true;
}
_DelaySyncActiveMdiChild();
}
And replace it with the following: if( nMessage == WM_MDIACTIVATE
|| nMessage == WM_MDIDESTROY
|| nMessage == WM_MDINEXT
)
{
if( nMessage == WM_MDINEXT
&& IsOleIpObjActive()
)
{
lResult = 0;
return true;
}
_DelaySyncActiveMdiChild();
_DelayUpdateMenuBar();
}
|
|
tera tera
|
Mar 24, 2009 - 12:05 AM
|
Hello. There is time when the selection of the grid is not drawn normally. (1), I let a grid scroll
(2), I choose a one cell
(3), I choose the cell of the last line while pushing shift.
A selection is not drawn normally The test environment is Prof2.85 (2009-01-14). http://ifreeta.dee.cc/20090324/SampleMuGrid200903a.lzh
|
|
Technical Support
|
Mar 24, 2009 - 9:46 AM
|
Thank you for reporting this issue. To fix it, please update the source code for the following method:
void CExtGridBaseWnd::OnLButtonDown(UINT nFlags, CPoint point)
{
ASSERT_VALID( this );
if( m_eMTT != __EMTT_NOTHING )
{
SendMessage( WM_CANCELMODE );
if( m_eMTT != __EMTT_NOTHING )
return;
} // if( m_eMTT != __EMTT_NOTHING )
UINT nRepCnt = 1;
static clock_t g_nLastClock = 0;
static HWND g_hWndLastClick = NULL;
static CPoint g_ptLastClick(-32767,-32767);
CPoint ptLastClick = point;
ClientToScreen( &ptLastClick );
clock_t nCurrClock = ::clock();
if( g_hWndLastClick == m_hWnd
&& g_ptLastClick == ptLastClick
)
{
clock_t nDiff = (clock_t)::abs( nCurrClock - g_nLastClock );
clock_t nDoubleClickTime = (clock_t)::GetDoubleClickTime();
if( nDiff <= nDoubleClickTime )
nRepCnt = 2;
}
g_ptLastClick = ptLastClick;
g_hWndLastClick = m_hWnd;
g_nLastClock = nCurrClock;
HWND hWndOwn = m_hWnd, hWndFocus = ::GetFocus();
if( ( hWndFocus != m_hWnd ) && ( m_nMouseActivateCode == MA_ACTIVATE || m_nMouseActivateCode == MA_ACTIVATEANDEAT ) )
{ // check MDI child frame activation explicitly
bool bIsMDIChildWindow = false;
// find the parent frame of the window that was just clicked
HWND hWndActivate = ::GetParent( hWndOwn );
for( ; hWndActivate != NULL; hWndActivate = ::GetParent( hWndActivate ) )
{
__EXT_MFC_LONG_PTR dwWndStyle = ::__EXT_MFC_GetWindowLong( hWndActivate, GWL_STYLE );
if( ( dwWndStyle & WS_CHILD ) == 0 )
break;
__EXT_MFC_LONG_PTR dwWndStyleEx = ::__EXT_MFC_GetWindowLong( hWndActivate, GWL_EXSTYLE );
if( ( dwWndStyleEx & WS_EX_MDICHILD ) == 0 )
continue;
bIsMDIChildWindow = true;
break;
} // for( ; hWndActivate != NULL; hWndActivate = ::GetParent( hWndActivate ) )
if( bIsMDIChildWindow )
{
// find the parent frame of the window that has focus
bIsMDIChildWindow = false;
HWND hWndActivate2 = hWndFocus;
for( ; hWndActivate2 != NULL; hWndActivate2 = ::GetParent( hWndActivate2 ) )
{
__EXT_MFC_LONG_PTR dwWndStyle = ::__EXT_MFC_GetWindowLong( hWndActivate2, GWL_STYLE );
if( ( dwWndStyle & WS_CHILD ) == 0 )
break;
__EXT_MFC_LONG_PTR dwWndStyleEx = ::__EXT_MFC_GetWindowLong( hWndActivate2, GWL_EXSTYLE );
if( ( dwWndStyleEx & WS_EX_MDICHILD ) == 0 )
continue;
bIsMDIChildWindow = true;
break;
} // for( ; hWndActivate2 != NULL; hWndActivate2 = ::GetParent( hWndActivate2 ) )
if( hWndActivate != hWndActivate2 )
{ // if windows are in different frames, set the focus to the new frame
ActivateTopParent();
CFrameWnd * pFrame = GetParentFrame();
if( pFrame != NULL )
{
CMDIChildWnd * pMDIChildWnd = DYNAMIC_DOWNCAST( CMDIChildWnd, pFrame );
if( pMDIChildWnd != NULL )
{
pMDIChildWnd->MDIActivate();
pMDIChildWnd->SetFocus();
} // if( pMDIChildWnd != NULL )
} // if( pFrame != NULL )
} // if windows are in different frames, set the focus to the new frame
}
if( ::GetFocus() != m_hWnd )
SetFocus();
} // check MDI child frame activation explicitly
if( OnGbwAnalyzeCellMouseClickEvent(VK_LBUTTON,nRepCnt,nFlags,point) )
return;
LONG nColumnCount = ColumnCountGet();
LONG nRowCount = RowCountGet();
CExtGridHitTestInfo htInfo( point );
HitTest( htInfo, true, true );
DWORD dwSiwStyles = SiwGetStyle();
if( (dwSiwStyles & __EGBS_RESIZING_CELLS_MASK) != 0 )
{
if( htInfo.m_nColNo >= 0 && htInfo.m_nRowNo >= 0
&& (htInfo.m_dwAreaFlags & __EGBWA_NEAR_CELL_BORDER_SIDE_MASK) != 0
)
{
INT nColType = htInfo.GetInnerOuterTypeOfColumn();
INT nRowType = htInfo.GetInnerOuterTypeOfRow();
if( nColType == 0 || nRowType == 0 )
{
CSize _sizeJoin = OnGbwCellJoinQueryInfo( htInfo.m_nColNo, htInfo.m_nRowNo, nColType, nRowType );
if( nColType == 0 && _sizeJoin.cx > 1 )
{
htInfo.m_nColNo += _sizeJoin.cx - 1;
htInfo.m_rcPart.SetRectEmpty();
INT nExtraSpaceBefore = 0, nExtraSpaceAfter = 0;
INT nItemExtent = OnSiwQueryItemExtentH( htInfo.m_nColNo, &nExtraSpaceBefore, &nExtraSpaceAfter );
htInfo.m_rcExtra.left = htInfo.m_rcExtra.right - nItemExtent;
htInfo.m_rcItem.left = htInfo.m_rcExtra.left + nExtraSpaceBefore;
htInfo.m_rcItem.right = htInfo.m_rcExtra.right + nExtraSpaceAfter;
} // if( nColType == 0 && _sizeJoin.cx > 1 )
if( nRowType == 0 && _sizeJoin.cy > 1 )
{
htInfo.m_nRowNo += _sizeJoin.cy - 1;
htInfo.m_rcPart.SetRectEmpty();
INT nExtraSpaceBefore = 0, nExtraSpaceAfter = 0;
INT nItemExtent = OnSiwQueryItemExtentV( htInfo.m_nRowNo, &nExtraSpaceBefore, &nExtraSpaceAfter );
htInfo.m_rcExtra.top = htInfo.m_rcExtra.bottom - nItemExtent;
htInfo.m_rcItem.top = htInfo.m_rcExtra.top + nExtraSpaceBefore;
htInfo.m_rcItem.bottom = htInfo.m_rcExtra.bottom + nExtraSpaceAfter;
} // if( nRowType == 0 && _sizeJoin.cy > 1 )
} // if( nRowType == 0 || nRowType == 0 )
m_nTrackExtentMin
= m_nTrackExtentMax
= m_nTrackExtentCurrent
= 0;
if( (htInfo.m_dwAreaFlags & __EGBWA_INNER_CELLS) != 0 )
{
if( (htInfo.m_dwAreaFlags & __EGBWA_NEAR_CELL_BORDER_V) != 0
&& (dwSiwStyles & __EGBS_RESIZING_CELLS_INNER_V) != 0
&& htInfo.m_nRowNo >= 0
&& OnGbwCanResizeRow( htInfo.m_nRowNo, &m_nTrackExtentMin, &m_nTrackExtentMax )
)
{
//m_nTrackExtentCurrent = htInfo.m_rcItem.Height();
m_nTrackExtentCurrent = OnSiwQueryItemExtentV( htInfo.m_nRowNo );
OnGbwResizingAdjustComputedTrackExtent( m_nTrackExtentCurrent, m_nTrackExtentMin, m_nTrackExtentMax, htInfo, false );
ASSERT(
m_nTrackExtentMin >= 0
&& m_nTrackExtentMax >= 0
&& m_nTrackExtentMin <= m_nTrackExtentMax
&& m_nTrackExtentCurrent >= 0
&& m_nTrackExtentMin <= m_nTrackExtentCurrent
&& m_nTrackExtentCurrent <= m_nTrackExtentMax
);
// start row resizing
_DoSetCursor();
m_htInfoResizing = htInfo;
// m_htInfoResizing.m_ptClient.y = htInfo.m_rcItem.top - 1;
// HitTest( m_htInfoResizing, true, true );
m_eMTT = __EMTT_RESIZING_V;
m_ptLastME = point;
OnGbwResizingAdjustHtInfo( m_htInfoResizing );
CExtMouseCaptureSink::SetCapture( m_hWnd );
OnGbwResizingStateUpdate( true, false, &point );
return;
}
if( (htInfo.m_dwAreaFlags & __EGBWA_NEAR_CELL_BORDER_H) != 0
&& (dwSiwStyles & __EGBS_RESIZING_CELLS_INNER_H) != 0
&& htInfo.m_nColNo >= 0
&& OnGbwCanResizeColumn( htInfo.m_nColNo, &m_nTrackExtentMin, &m_nTrackExtentMax )
)
{
//m_nTrackExtentCurrent = htInfo.m_rcItem.Width();
m_nTrackExtentCurrent = OnSiwQueryItemExtentH( htInfo.m_nColNo );
OnGbwResizingAdjustComputedTrackExtent( m_nTrackExtentCurrent, m_nTrackExtentMin, m_nTrackExtentMax, htInfo, true );
ASSERT(
m_nTrackExtentMin >= 0
&& m_nTrackExtentMax >= 0
&& m_nTrackExtentMin <= m_nTrackExtentMax
&& m_nTrackExtentCurrent >= 0
&& m_nTrackExtentMin <= m_nTrackExtentCurrent
&& m_nTrackExtentCurrent <= m_nTrackExtentMax
);
// start column resizing
_DoSetCursor();
m_htInfoResizing = htInfo;
// m_htInfoResizing.m_ptClient.x = htInfo.m_rcItem.left - 1;
// HitTest( m_htInfoResizing, true, true );
m_eMTT = __EMTT_RESIZING_H;
m_ptLastME = point;
OnGbwResizingAdjustHtInfo( m_htInfoResizing );
CExtMouseCaptureSink::SetCapture( m_hWnd );
OnGbwResizingStateUpdate( true, false, &point );
return;
}
} // if( (htInfo.m_dwAreaFlags & __EGBWA_INNER_CELLS) != 0 )
else if(
(htInfo.m_dwAreaFlags & __EGBWA_OUTER_CELLS) != 0
&& ( htInfo.GetInnerOuterTypeOfColumn() == 0
|| htInfo.GetInnerOuterTypeOfRow() == 0
)
)
{
if( (htInfo.m_dwAreaFlags & __EGBWA_NEAR_CELL_BORDER_V) != 0
&& (htInfo.m_dwAreaFlags & __EGBWA_OUTER_H ) != 0
&& (dwSiwStyles & __EGBS_RESIZING_CELLS_OUTER_V) != 0
&& htInfo.m_nRowNo >= 0
&& OnGbwCanResizeRow( htInfo.m_nRowNo, &m_nTrackExtentMin, &m_nTrackExtentMax )
)
{
//m_nTrackExtentCurrent = htInfo.m_rcItem.Height();
m_nTrackExtentCurrent = OnSiwQueryItemExtentV( htInfo.m_nRowNo );
OnGbwResizingAdjustComputedTrackExtent( m_nTrackExtentCurrent, m_nTrackExtentMin, m_nTrackExtentMax, htInfo, false );
ASSERT(
m_nTrackExtentMin >= 0
&& m_nTrackExtentMax >= 0
&& m_nTrackExtentMin <= m_nTrackExtentMax
&& m_nTrackExtentCurrent >= 0
&& m_nTrackExtentMin <= m_nTrackExtentCurrent
&& m_nTrackExtentCurrent <= m_nTrackExtentMax
);
// start row resizing
_DoSetCursor();
m_htInfoResizing = htInfo;
// m_htInfoResizing.m_ptClient.y = htInfo.m_rcItem.top - 1;
// HitTest( m_htInfoResizing, true, true );
m_eMTT = __EMTT_RESIZING_V;
m_ptLastME = point;
OnGbwResizingAdjustHtInfo( m_htInfoResizing );
CExtMouseCaptureSink::SetCapture( m_hWnd );
OnGbwResizingStateUpdate( true, false, &point );
return;
}
if( (htInfo.m_dwAreaFlags & __EGBWA_NEAR_CELL_BORDER_H) != 0
&& (htInfo.m_dwAreaFlags & __EGBWA_OUTER_V ) != 0
&& (dwSiwStyles & __EGBS_RESIZING_CELLS_OUTER_H) != 0
&& htInfo.m_nColNo >= 0
&& OnGbwCanResizeColumn( htInfo.m_nColNo, &m_nTrackExtentMin, &m_nTrackExtentMax )
)
{
//m_nTrackExtentCurrent = htInfo.m_rcItem.Width();
m_nTrackExtentCurrent = OnSiwQueryItemExtentH( htInfo.m_nColNo );
OnGbwResizingAdjustComputedTrackExtent( m_nTrackExtentCurrent, m_nTrackExtentMin, m_nTrackExtentMax, htInfo, true );
ASSERT(
m_nTrackExtentMin >= 0
&& m_nTrackExtentMax >= 0
&& m_nTrackExtentMin <= m_nTrackExtentMax
&& m_nTrackExtentCurrent >= 0
&& m_nTrackExtentMin <= m_nTrackExtentCurrent
&& m_nTrackExtentCurrent <= m_nTrackExtentMax
);
// start column resizing
_DoSetCursor();
m_htInfoResizing = htInfo;
// m_htInfoResizing.m_ptClient.x = htInfo.m_rcItem.left - 1;
// HitTest( m_htInfoResizing, true, true );
m_eMTT = __EMTT_RESIZING_H;
m_ptLastME = point;
OnGbwResizingAdjustHtInfo( m_htInfoResizing );
CExtMouseCaptureSink::SetCapture( m_hWnd );
OnGbwResizingStateUpdate( true, false, &point );
return;
}
} // else if( (htInfo.m_dwAreaFlags & __EGBWA_OUTER_CELLS) != 0 ...
} // if( htInfo.m_nColNo >= 0 && htInfo.m_nRowNo >= 0 ...
} // if( (dwSiwStyles & __EGBS_RESIZING_CELLS_MASK) != 0 )
HitTest( htInfo, false, true );
if( OnGbwDataDndCanStart( htInfo ) )
{
m_eMTT = __EMTT_DATA_DND_STARTING;
CExtMouseCaptureSink::SetCapture( m_hWnd );
return;
} // if( OnGbwDataDndCanStart( htInfo ) )
if( (dwSiwStyles & __EGBS_SFB_MASK) != __EGBS_SFB_NONE
&& ( htInfo.m_nColNo >= 0 || htInfo.m_nRowNo >= 0 )
)
{ // if any selection mode can be tracked
INT nAreaCount = SelectionGetAreaCount();
bool bAlt = ( (::GetAsyncKeyState(VK_MENU)&0x8000) != 0 ) ? true : false;
bool bCtrl = ( (::GetAsyncKeyState(VK_CONTROL)&0x8000) != 0 ) ? true : false;
bool bShift = ( (::GetAsyncKeyState(VK_SHIFT)&0x8000) != 0 ) ? true : false;
bool bCtrlOnly = bCtrl && (!bAlt) && (!bShift);
bool bShiftOnly = (!bCtrl) && (!bAlt) && bShift;
bool bNoModifiers = (!bCtrl) && (!bAlt) && (!bShift);
bool bMultiAreaSelection = MultiAreaSelectionGet();
bool bReplaceOldSelection =
(!bMultiAreaSelection)
|| (!(bCtrlOnly || bShiftOnly));
if( bNoModifiers )
{
if( OnGbwAnalyzeCellMouseClickEvent(VK_LBUTTON,3,nFlags,point) )
return;
}
if( (htInfo.m_dwAreaFlags & __EGBWA_OUTER_CELLS) != 0 )
{
if( ( htInfo.m_dwAreaFlags & __EGBWA_OUTER_H ) != 0
&& ( htInfo.m_dwAreaFlags & __EGBWA_OUTER_V ) == 0
&& ( dwSiwStyles & __EGBS_SF_SELECT_OUTER_ROWS ) != 0
&& htInfo.m_nRowNo >= 0
&& nColumnCount > 0
&& ( ( dwSiwStyles & __EGBS_SFB_MASK ) == __EGBS_SFB_FULL_ROWS
|| ( ( dwSiwStyles & __EGBS_SFB_MASK ) == __EGBS_SFB_CELLS
&& ( dwSiwStyles & __EGBS_SFM_ROWS ) != 0
)
)
)
{
INT nSelectionExtent = 0;
INT nColType = htInfo.GetInnerOuterTypeOfColumn();
INT nRowType = htInfo.GetInnerOuterTypeOfRow();
CSize _sizeJoin = OnGbwCellJoinQueryInfo( htInfo.m_nColNo, htInfo.m_nRowNo, nColType, nRowType );
if( _sizeJoin.cy >= 0 )
nSelectionExtent = _sizeJoin.cy - 1;
CRect rcSelection( nColumnCount - 1, htInfo.m_nRowNo, 0, htInfo.m_nRowNo + nSelectionExtent );
if( (htInfo.m_dwAreaFlags & __EGBWA_OUTER_RIGHT ) != 0 )
{
LONG n = rcSelection.right;
rcSelection.right = rcSelection.left;
rcSelection.left = n;
} // if( (htInfo.m_dwAreaFlags & __EGBWA_OUTER_RIGHT ) != 0 )
if( (dwSiwStyles & __EGBS_SFM_ROWS) != 0
&& bShiftOnly
&& nAreaCount > 0
)
{
CRect rcSelection = SelectionGet( false, nAreaCount - 1 );
if( rcSelection.bottom != htInfo.m_nRowNo )
{
rcSelection.bottom = htInfo.m_nRowNo;
FocusSet( CPoint(FocusGet().x, htInfo.m_nRowNo), false, false, false, false );
VERIFY( SelectionSetAt( nAreaCount - 1, rcSelection, false ) );
if( nSelectionExtent > 0 )
EnsureVisibleColumn( htInfo.m_nRowNo + nSelectionExtent, true );
EnsureVisibleRow( htInfo.m_nRowNo, true );
}
return;
}
if( ! AutoFocusBottomRightGet() )
FocusSet( CPoint(FocusGet().x, htInfo.m_nRowNo), false, false, false, false );
SelectionSet( rcSelection, bReplaceOldSelection, false, false );
EnsureVisibleRow( htInfo.m_nRowNo, false );
OnSwInvalidate( true );
if( ! LbExtSelectionGet() )
return;
if( (dwSiwStyles & __EGBS_SFM_ROWS) != 0 )
{
m_eMTT = __EMTT_SEL_OUTER_ROWS;
m_ptLastME = point;
CExtMouseCaptureSink::SetCapture( m_hWnd );
_DoSetCursor();
}
return;
}
if( ( htInfo.m_dwAreaFlags & __EGBWA_OUTER_H ) == 0
&& ( htInfo.m_dwAreaFlags & __EGBWA_OUTER_V ) != 0
&& ( dwSiwStyles & __EGBS_SF_SELECT_OUTER_COLUMNS ) != 0
&& htInfo.m_nColNo >= 0
&& nRowCount > 0
&& ( ( dwSiwStyles & __EGBS_SFB_MASK ) == __EGBS_SFB_FULL_COLUMNS
|| ( ( dwSiwStyles & __EGBS_SFB_MASK ) == __EGBS_SFB_CELLS
&& ( dwSiwStyles & __EGBS_SFM_COLUMNS ) != 0
)
)
)
{
INT nSelectionExtent = 0;
INT nColType = htInfo.GetInnerOuterTypeOfColumn();
INT nRowType = htInfo.GetInnerOuterTypeOfRow();
CSize _sizeJoin = OnGbwCellJoinQueryInfo( htInfo.m_nColNo, htInfo.m_nRowNo, nColType, nRowType );
if( _sizeJoin.cx >= 0 )
nSelectionExtent = _sizeJoin.cx - 1;
CRect rcSelection( htInfo.m_nColNo, nRowCount - 1, htInfo.m_nColNo + nSelectionExtent, 0 );
if( (htInfo.m_dwAreaFlags & __EGBWA_OUTER_BOTTOM ) != 0 )
{
LONG n = rcSelection.bottom;
rcSelection.bottom = rcSelection.top;
rcSelection.top = n;
} // if( (htInfo.m_dwAreaFlags & __EGBWA_OUTER_BOTTOM ) != 0 )
if( (dwSiwStyles & __EGBS_SFM_COLUMNS) != 0
&& bShiftOnly
&& nAreaCount > 0
)
{
CRect rcSelection = SelectionGet( false, nAreaCount - 1 );
if( rcSelection.right != htInfo.m_nColNo )
{
rcSelection.right = htInfo.m_nColNo;
FocusSet( CPoint(htInfo.m_nColNo, FocusGet().y), false, false, false, false );
VERIFY( SelectionSetAt( nAreaCount - 1, rcSelection, false ) );
if( nSelectionExtent > 0 )
EnsureVisibleColumn( htInfo.m_nColNo + nSelectionExtent, true );
EnsureVisibleColumn( htInfo.m_nColNo, true );
}
return;
}
if( ! AutoFocusBottomRightGet() )
FocusSet( CPoint(htInfo.m_nColNo, FocusGet().y), false, false, false, false );
SelectionSet( rcSelection, bReplaceOldSelection, false, false );
EnsureVisibleColumn( htInfo.m_nColNo, false );
OnSwInvalidate( true );
if( ! LbExtSelectionGet() )
return;
if( (dwSiwStyles & __EGBS_SFM_COLUMNS) != 0 )
{
m_eMTT = __EMTT_SEL_OUTER_COLUMNS;
m_ptLastME = point;
CExtMouseCaptureSink::SetCapture( m_hWnd );
_DoSetCursor();
}
return;
}
} // if( (htInfo.m_dwAreaFlags & __EGBWA_OUTER_CELLS) != 0 ...
if( (htInfo.m_dwAreaFlags & __EGBWA_INNER_CELLS) != 0 )
{
DWORD dwScrollTypeH = SiwScrollTypeHGet();
DWORD dwScrollTypeV = SiwScrollTypeVGet();
if( (dwSiwStyles & __EGBS_SFB_MASK) == __EGBS_SFB_FULL_COLUMNS )
{
if( htInfo.m_nColNo >= 0 )
{
if( (dwSiwStyles & __EGBS_SFM_COLUMNS) != 0
&& OnGbwDataDndIsAllowed()
&& ( bNoModifiers
|| ( bCtrlOnly
&& SelectionGetForCell( htInfo.m_nColNo, 0 )
&& (!bReplaceOldSelection)
)
)
)
return; // process in WM_LBUTTONUP
if( (dwSiwStyles & __EGBS_SFM_COLUMNS) != 0
&& bShiftOnly
&& nAreaCount > 0
)
{
CRect rcSelection = SelectionGet( false, nAreaCount - 1 );
if( rcSelection.right != htInfo.m_nColNo )
{
rcSelection.right = htInfo.m_nColNo;
FocusSet( CPoint(htInfo.m_nColNo, htInfo.m_nRowNo), false, false, false, false );
VERIFY( SelectionSetAt( nAreaCount - 1, rcSelection, false ) );
EnsureVisibleColumn( htInfo.m_nColNo, false );
OnSwInvalidate( true );
}
return;
}
if( ! AutoFocusBottomRightGet() )
FocusSet( CPoint(htInfo.m_nColNo, htInfo.m_nRowNo), false, false, false, false );
CRect rcSelection( htInfo.m_nColNo, 0, htInfo.m_nColNo, nRowCount-1 );
SelectionSet( rcSelection, bReplaceOldSelection, false, false );
EnsureVisibleColumn( htInfo.m_nColNo, false );
OnSwInvalidate( true );
if( ! LbExtSelectionGet() )
return;
if( (dwSiwStyles & __EGBS_SFM_COLUMNS) != 0 )
{
m_eMTT = __EMTT_SEL_INNER_COLUMNS;
m_ptLastME = point;
CExtMouseCaptureSink::SetCapture( m_hWnd );
_DoSetCursor();
}
} // if( htInfo.m_nColNo >= 0 )
return;
} // if( (dwSiwStyles & __EGBS_SFB_MASK) == __EGBS_SFB_FULL_COLUMNS )
else if( (dwSiwStyles & __EGBS_SFB_MASK) == __EGBS_SFB_FULL_ROWS )
{
if( htInfo.m_nRowNo >= 0 )
{
if( (dwSiwStyles & __EGBS_SFM_ROWS) != 0
&& OnGbwDataDndIsAllowed()
&& ( bNoModifiers
|| ( bCtrlOnly
&& SelectionGetForCell( 0, htInfo.m_nRowNo )
&& (!bReplaceOldSelection)
)
)
)
return; // process in WM_LBUTTONUP
if( (dwSiwStyles & __EGBS_SFM_ROWS) != 0
&& bShiftOnly
&& nAreaCount > 0
)
{
CRect rcSelection = SelectionGet( false, nAreaCount - 1 );
if( rcSelection.bottom != htInfo.m_nRowNo )
{
rcSelection.bottom = htInfo.m_nRowNo;
FocusSet( CPoint(htInfo.m_nColNo, htInfo.m_nRowNo), false, false, false, false );
VERIFY( SelectionSetAt( nAreaCount - 1, rcSelection, false ) );
EnsureVisibleRow( htInfo.m_nRowNo, false );
OnSwInvalidate( true );
}
return;
}
if( ! AutoFocusBottomRightGet() )
FocusSet( CPoint(htInfo.m_nColNo, htInfo.m_nRowNo), false, false, false, false );
CRect rcSelection( 0, htInfo.m_nRowNo, nColumnCount-1, htInfo.m_nRowNo );
SelectionSet( rcSelection, bReplaceOldSelection, false, false );
EnsureVisibleRow( htInfo.m_nRowNo, false );
OnSwInvalidate( true );
if( ! LbExtSelectionGet() )
return;
if( (dwSiwStyles & __EGBS_SFM_ROWS) != 0 )
{
m_eMTT = __EMTT_SEL_INNER_ROWS;
m_ptLastME = point;
CExtMouseCaptureSink::SetCapture( m_hWnd );
_DoSetCursor();
}
} // if( htInfo.m_nRowNo >= 0 )
return;
} // else if( (dwSiwStyles & __EGBS_SFB_MASK) == __EGBS_SFB_FULL_ROWS )
else
{
ASSERT( (dwSiwStyles & __EGBS_SFB_MASK) == __EGBS_SFB_CELLS );
if( 0 <= htInfo.m_nColNo && (htInfo.m_nColNo < nColumnCount || dwScrollTypeH == __ESIW_ST_VIRTUAL )
&& 0 <= htInfo.m_nRowNo && (htInfo.m_nRowNo < nRowCount || dwScrollTypeV == __ESIW_ST_VIRTUAL )
)
{ // if column and row numbers specified
ASSERT( m_eMTT == __EMTT_NOTHING );
CPoint ptNewFocus( htInfo.m_nColNo, htInfo.m_nRowNo );
if( bReplaceOldSelection )
FocusSet( ptNewFocus, true, true, true, true );
else
{
if( (dwSiwStyles & (__EGBS_SFM_ROWS|__EGBS_SFM_COLUMNS)) != 0
&& OnGbwDataDndIsAllowed()
&& ( bNoModifiers
|| ( bCtrlOnly
&& SelectionGetForCell( htInfo.m_nColNo, htInfo.m_nRowNo )
&& (!bReplaceOldSelection)
)
)
)
return; // process in WM_LBUTTONUP
if( (dwSiwStyles & (__EGBS_SFM_ROWS|__EGBS_SFM_COLUMNS)) != 0
&& bShiftOnly
&& nAreaCount > 0
)
{
CRect rcSelection = SelectionGet( false, nAreaCount - 1 );
if( ( rcSelection.bottom != htInfo.m_nRowNo
&& (dwSiwStyles & __EGBS_SFM_ROWS) != 0
)
|| ( rcSelection.right != htInfo.m_nColNo
&& (dwSiwStyles & __EGBS_SFM_COLUMNS) != 0
)
)
{
CPoint ptFocus = FocusGet();
if( (dwSiwStyles & __EGBS_SFM_ROWS) != 0 )
{
rcSelection.bottom = htInfo.m_nRowNo;
ptFocus.y = htInfo.m_nRowNo;
}
if( (dwSiwStyles & __EGBS_SFM_COLUMNS) != 0 )
{
rcSelection.right = htInfo.m_nColNo;
ptFocus.x = htInfo.m_nColNo;
}
FocusSet( ptFocus, false, false, false, false );
VERIFY( SelectionSetAt( nAreaCount - 1, rcSelection, true ) );
}
return;
}
if( ! AutoFocusBottomRightGet() )
FocusSet( ptNewFocus, true, true, false, false );
SelectionSet( ptNewFocus, false, false, true );
} // else from if( bReplaceOldSelection )
if( ! LbExtSelectionGet() )
return;
switch( (dwSiwStyles & (__EGBS_SFM_COLUMNS|__EGBS_SFM_ROWS) ) )
{
case 0L:
return;
case __EGBS_SFM_COLUMNS:
m_eMTT = __EMTT_SEL_VAR_COLUMNS;
m_ptLastME = point;
break;
case __EGBS_SFM_ROWS:
m_eMTT = __EMTT_SEL_VAR_ROWS;
m_ptLastME = point;
break;
case __EGBS_SFM_COLUMNS|__EGBS_SFM_ROWS:
m_eMTT = __EMTT_SEL_VAR_RANGE;
m_ptLastME = point;
break;
#ifdef _DEBUG
default:
ASSERT( FALSE );
break;
#endif // _DEBUG
} // switch( (dwSiwStyles & (__EGBS_SFM_COLUMNS|__EGBS_SFM_ROWS) ) )
ASSERT( m_eMTT != __EMTT_NOTHING );
CExtMouseCaptureSink::SetCapture( m_hWnd );
_DoSetCursor();
return;
} // if column and row numbers specified
} // else from else if( (dwSiwStyles & __EGBS_SFB_MASK) == __EGBS_SFB_FULL_ROWS )
return;
} // if( (htInfo.m_dwAreaFlags & __EGBWA_INNER_CELLS) != 0 )
} // if any selection mode can be tracked
CExtScrollItemWnd::OnLButtonDown(nFlags, point);
}
|
|
tera tera
|
Mar 24, 2009 - 7:52 PM
|
Hello. >To fix it, please update the source code for the following method: I want to download a revision from ftp[prof-uis-com].
Please tell the schedule.
|
|
Technical Support
|
Mar 25, 2009 - 6:28 AM
|
No problem. Please drop us an e-mail so we will reply with how to download it.
|
|
Robert Webb
|
Mar 24, 2009 - 12:04 AM
|
Hi, I want to have a menu that drops down from the right-button-collection area, but whose contents changes depending on context. I have already created another similar static menu. That’s easy enough, by creating a node, adding it to the right button collection, and adding other child nodes which act as menu items. But how do I get called back when the user clicks on the menu button so that I can fill in the menu before it pops up? I guess I also need to delete it again after it’s closed. Thanks, Rob.
|
|
Robert Webb
|
Nov 27, 2009 - 1:05 AM
|
When using ProfUIS, various things may pop up, such as menus, tooltips, etc. These may overlap with the main workspace. Our application uses OpenGL for graphics, and rendering a scene can be quite computationally expensive, so we wish to avoid redraws whenever possible.
Now some things that pop up cause a paint message to be sent, and some do not. For example, with a ribbon bar, the main application menu may be quite large, but it does not send a paint message for the view area, although it overlaps. I believe it grabs a bitmap and replaces it afterwards?
Drop-downs from ribbon bar items also avoid sending a paint message.
However, tooltips and old-style menus from a menu bar DO send a paint message. Tooltips are particularly troublesome, because just pausing the mouse somewhere can cause the main window to redraw. A tooltip comes up, and when it goes away a paint message is sent. Tooltips may also appear while browsing through a drop-down menu from the ribbon bar. A redraw at this point draws over the drop-down, since it overlaps our drawing area, leaving a bit of a mess on the screen, and it seems to almost hang sometimes just when moving the mouse up and down on such a menu, until the mouse is moved off the edge.
Anyway, is there a way to avoid the redraw for tooltips? Can they be handled the same way as the application menu and other ribbon bar drop-downs? And same question for old-style menus from the menubar.
On the other hand, sometimes we actually want to redraw while the application menu is open. For example, we select a recently used file. It loads and redraws while the menu is still fading out. However, as the menu fades out it is replaced by the previous contents of the window, after which the view remains drawn incorrectly until next forced to redraw. So I’m also wondering if you have any advice for this.
Thanks,
Rob.
|
|
Robert Webb
|
Nov 27, 2009 - 1:06 AM
|
Oops sorry, this was meant to go in a new thread, but there’s no way to delete a message in this forum (hint hint). I’ll post this again as a new topic, please respond there. Thanks, Rob.
|
|
Technical Support
|
Mar 24, 2009 - 1:17 PM
|
You don’t need to construct/remove command tree nodes. Please do the following:
http://www.prof-uis.com/prof-uis/tech-support/faq/pop-up-menus.aspx#how-to-insert-menu-items-at-run-time
You should initialize a drop-down button inside the right buttons collection. This button should have only one menu item with predefined command identifier. This menu item is called a "marker item". You should handle the CExtPopupMenuWnd::g_nMsgPrepareMenu registered message as it is described in the F.A.Q. but you should handle it in your CExtRibbonBar -derived class. Each time your handler method is invoked it will deal with the popup menu having only one marker item (it’s ID_MY_REPLACE_CMD in the F.A.Q. referenced above).
|
|
Offer Har
|
Mar 23, 2009 - 3:36 PM
|
|
|
Technical Support
|
Mar 24, 2009 - 2:28 PM
|
We have 3 issues reported by you under development: tree item hide issue (not fixed yet), fast 3 mouse clicks issue (still cannot reproduce it) and MDI crash issue (fixed).
To fix the MDI crash issue, please find the following code in the CExtMenuControlBar::OnHookWndMsg() method:
if( nMessage == WM_MDIACTIVATE
|| nMessage == WM_MDIDESTROY
|| nMessage == WM_MDINEXT
)
{
if( nMessage == WM_MDINEXT
&& IsOleIpObjActive()
)
{
lResult = 0;
return true;
}
_DelaySyncActiveMdiChild();
}
And replace it with the following: if( nMessage == WM_MDIACTIVATE
|| nMessage == WM_MDIDESTROY
|| nMessage == WM_MDINEXT
)
{
if( nMessage == WM_MDINEXT
&& IsOleIpObjActive()
)
{
lResult = 0;
return true;
}
_DelaySyncActiveMdiChild();
_DelayUpdateMenuBar();
}
|
|
tera tera
|
Mar 23, 2009 - 1:46 AM
|
Hello. In the following procedures,
When we operate a bar , MDI freezes. 1, You double-click CView 2, You let a bar make a float and close a bar 3, MDI does not react The test environment is Prof2.85 (2009-01-14).
http://ifreeta.dee.cc/20090323/SampleMDITest.lzh
|
|
Technical Support
|
Mar 24, 2009 - 9:32 AM
|
View windows are specific in MFC. They are mainly designed as part of MFC’s document view architecture. Of course, you can use it without document connection like you did in dialog (CNxfRitsumenInDlg and CNxkCView ) at your own risk, but results of such experiments sometimes can be really fun. That is what’s really happen in your project. The behavior problem after double clicking view and closing the floating bar is not a problem of Prof-UIS. This problem is brought by the following two methods in MFC source code:
void CView::OnActivateView(BOOL bActivate, CView* pActivateView, CView*)
{
UNUSED(pActivateView); // unused in release builds
if (bActivate)
{
ASSERT(pActivateView == this);
// take the focus if this frame/view/pane is now active
if (IsTopParentActive())
SetFocus();
}
}
void CView::OnActivateFrame(UINT /*nState*/, CFrameWnd* /*pFrameWnd*/)
{
}
int CView::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
{
int nResult = CWnd::OnMouseActivate(pDesktopWnd, nHitTest, message);
if (nResult == MA_NOACTIVATE || nResult == MA_NOACTIVATEANDEAT)
return nResult; // frame does not want to activate
CFrameWnd* pParentFrame = GetParentFrame();
if (pParentFrame != NULL)
{
// eat it if this will cause activation
ASSERT(pParentFrame == pDesktopWnd || pDesktopWnd->IsChild(pParentFrame));
// either re-activate the current view, or set this view to be active
CView* pView = pParentFrame->GetActiveView();
HWND hWndFocus = ::GetFocus();
if (pView == this &&
m_hWnd != hWndFocus && !::IsChild(m_hWnd, hWndFocus))
{
// re-activate this view
OnActivateView(TRUE, this, this);
}
else
{
// activate this view
pParentFrame->SetActiveView(this);
}
}
return nResult;
}
Both methods do what is absolutely not needed for view window detached from document and created inside dialog. The CView::OnActivateView() invokes the SetFocus() even without view visibility check and even worst - without checking whether the view window is part of document view architecture. The CView::OnMouseActivate() has the same bad problems – it invokes the pParentFrame->SetActiveView(this) code without analyzing kind of view window and its connection with document object. We fixed the problem in scope of your test project. We added the CNxkCView::OnActivateView() method which does not invoke parent class method. We handled the WM_MOUSEACTIVATE message in the CNxkCView::WindowProc() virtual method. Here is the modified version of your project: http://www.prof-uis.com/download/forums/tmp/SampleMDITest_modified_for_tera_t.zip
|
|
tera tera
|
Mar 25, 2009 - 1:13 AM
|
Hello. In View, WM_MOUSEDOWN does not fly
This is fatal. Give my best regards. LRESULT CNxkCView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if( message == WM_MOUSEACTIVATE )
return MA_ACTIVATEANDEAT; switch( message )
{
case WM_LBUTTONDOWN:
{
TRACE("MOUSE_DOWN \n");
}
break;
} return CView::WindowProc(message, wParam, lParam);
}
|
|
Technical Support
|
Mar 25, 2009 - 2:19 PM
|
The WM_LBUTTONDOWN messages are not received because of these two lines of code:
if( message == WM_MOUSEACTIVATE )
return MA_ACTIVATEANDEAT;
You can replace them with: if( message == WM_MOUSEACTIVATE )
return MA_ACTIVATE;
|
|
tera tera
|
Mar 21, 2009 - 12:44 AM
|
Hello. We are hard to understand the existence place of the combo.
I want to draw a frame line.
|
|
Technical Support
|
Mar 24, 2009 - 9:44 AM
|
It’s difficult to control the list box position inside the simple combo box common control. That is why we added themed border to the edit control only. It’s easier to replace such simple combo box with two independent edit and list box controls and then connect them to each other in scope of developed application.
|
|
Technical Support
|
Mar 23, 2009 - 6:06 AM
|
|
|
tera tera
|
Mar 24, 2009 - 1:00 AM
|
Hello. Is the emphasis display of CComboBox difficult?
|
|
tera tera
|
Mar 24, 2009 - 12:55 AM
|
Hello. I am hard to see a frame
Because even one color is good, cannot I appoint the color of the frame? Or,
I want you to emphasize the color of the frame more
|
|
Technical Support
|
Mar 24, 2009 - 9:45 AM
|
It’s difficult to control the list box position inside the simple combo box common control. That is why we added themed border to the edit control only. It’s easier to replace such simple combo box with two independent edit and list box controls and then connect them to each other in scope of developed application.
|
|
tera tera
|
Mar 24, 2009 - 7:54 PM
|
Hello. I am hard to see a frame
Because even one color is good, cannot I appoint the color of the frame? Or,
I want you to emphasize the color of the frame more
|
|
Krustys Donuts
|
Mar 18, 2009 - 4:44 PM
|
Dear Support, I have a CExtGridWnd grid that contains a custom cell that is derived from CExtGridCellEx. This cell displays two CExtBitmap objects. The functionallity I would like to achieve is as follows: When the cursor hovers over one bitmap, tooltip #1 is displayed and when the cursor hovers over the other bitmap, tooltip #2 is displayed. I have overriden OnInitAdvancedTip to provide this funcitonallity. The problem I have now is as follows: When the cursor hovers over the first bitmap the appropriate tooltip is displayed properly, but when the cursor is moved from the first bitmap to the second bitmap without leaving the cell, the second tooltip is not displayed. Is there any way to reset the hover timer when the cursor is moved off the first bitmap? Or is there a better approach with split cells? Thanks, Gil
|
|
Krustys Donuts
|
Mar 25, 2009 - 9:10 AM
|
I have implemented your suggestion, but still do not get exactly what I want. The cell contains two bitmaps: left and right. When the cusor is placed over the right bitmap, the expected tooltip is shown. When the cursor is moved from the right bitmap to the left bitmap, the displayed tooltip goes away, but the tooltip for the left bitmap is not displayed as desired. Below is the code:
bool CExtGridWnd & wndGrid, CExtPopupMenuTipWnd & _ATTW, RECT & rcArea) { ASSERT_VALID( ASSERT_VALID( (&wndGrid) ); ASSERT( ! htInfo.IsHoverEmpty() ); ASSERT( htInfo.IsValidRect() ); CSize szErrBmp = m_bmpAoError.GetSize(); VRCellErrWarnAndAo::OnInitAdvancedTip(const CExtGridHitTestInfo & htInfo,this );//Find the X postion of the mouse.CPoint ptCursor = htInfo.m_ptClient; CRect rAo = htInfo.m_rcExtra; rAo.DeflateRect(kAoIndent + szErrBmp.cx, 0,0,0); CRect rEW = htInfo.m_rcExtra; rEW.DeflateRect(kAoIndent, 0,0,0); //If the cursor is over the approach orientation icons. { { _ATTW.SetText(m_strAoTooltip.c_str()); rcArea = rAo; bValidTooltip = } } bool bValidTooltip = false;if (rAo.PtInRect(ptCursor))if (!m_strAoTooltip.empty())true;//If the cursor is over the error/warning icon. { else if (rEW.PtInRect(ptCursor))//If there is an error or warning for this approach orientaion. { _ATTW.SetText(m_strErrorWarningTooltip.c_str()); rcArea = rEW; bValidTooltip = } } } if (m_nErrType != VRApproOrientation::kNone)true;return bValidTooltip;
|
|
Technical Support
|
Mar 26, 2009 - 6:01 AM
|
Yes, you are right. There are additional details we forgot to mentioned. First of all, the __EGBS_EX_CELL_TOOLTIPS_INNER style should be applied and the __EGBS_EX_CELL_EXPANDING_INNER style should not present. Second, the hover events should be enabled inside the grid window. Third, you need a grid class like this:
class CMyGridWnd : public CExtNSB < CExtGridWnd >
{
public:
virtual bool OnGbwHoverRecalc(
const POINT * pPtClient = NULL
)
{
ASSERT_VALID( this );
m_htInfoHover.Empty();
return CExtNSB < CExtGridWnd > :: OnGbwHoverRecalc( pPtClient );
}
};
We created the following sample project for you: http://www.prof-uis.com/download/forums/OnCellTwoTips.zip
|
|
Technical Support
|
Mar 20, 2009 - 1:43 PM
|
The CExtGridCell::OnInitAdvancedTip() has a RECT & rcArea parameter which describes the entire grid cell location. This rectangle is used by the tooltip window which hides itself automatically when the mouse cursor is moved outside this rectangle. You should change the RECT & rcArea rectangle and make it describing location of one of your cell parts only. The const CExtGridHitTestInfo & htInfo parameter contains the CExtGridHitTestInfo::m_ptClient property describing mouse cursor position.
|
|
tera tera
|
Mar 18, 2009 - 12:33 AM
|
Hello. I MDI-Task is not displayed by task bar when I take the following programs.
Please teach a cause.
http://ifreeta.dee.cc/20090318/MDI.LZH // create main MDI frame window
if (!pFrame->LoadFrame(IDR_MAINFRAME))
return FALSE; // try to load shared MDI menus and accelerator table
//TODO: add additional member variables and load calls for
// additional menu types your application may need. HINSTANCE hInst = AfxGetResourceHandle();
m_hMDIMenu = ::LoadMenu(hInst, MAKEINTRESOURCE(IDR_MDITYPE));
m_hMDIAccel = ::LoadAccelerators(hInst, MAKEINTRESOURCE(IDR_MDITYPE)); //----------------------------------------------
pFrame->SetRedraw( FALSE ); // Data reading processing
int iRec;
for ( iRec = 0 ; iRec < 20 ; iRec++ ){
Sleep(100);
} pFrame->SetRedraw( TRUE ); pFrame->RedrawWindow(
NULL, NULL, RDW_INVALIDATE|RDW_ERASE|RDW_ALLCHILDREN|RDW_FRAME
);
pFrame->SetFocus();
//---------------------------------------------- // window placement persistence
pFrame->ActivateFrame( m_nCmdShow );
|
|
Technical Support
|
Mar 18, 2009 - 2:16 PM
|
This should be fixed in the CMDIApp::InitInstance() method. Just add the following two lines of code to the bottom of this method:
::SetActiveWindow( NULL );
pFrame->SetActiveWindow();
Before the last line: return TRUE;
|
|
tera tera
|
Mar 17, 2009 - 2:45 AM
|
Hello. I want to display ToolTip in around one second
|
|
Technical Support
|
Mar 17, 2009 - 10:13 AM
|
The RibbonBar sample initializes a lot of CExtCustomizeCmdScreenTip tooltips. Most buttons in the ribbon bar have screentips similar to those on your screenshot.
|
|
tera tera
|
Mar 23, 2009 - 2:38 AM
|
Hello. In hover of the mouse, I want to display a tool tip quickly.
I want to display a tool tip within one second.
Please teach a program method.
|
|
Technical Support
|
Mar 23, 2009 - 2:08 PM
|
Please invoke the following code in the constructor of your CExtRibbonBar -derived class:
m_wndScreenTip.m_nPeriodDelayShowQuick = m_wndScreenTip.m_nPeriodDelayShowNormal = 1;
|
|
tera tera
|
Mar 17, 2009 - 2:45 AM
|
Hello. I want to display ToolTip in around one second
|
|
Technical Support
|
Mar 17, 2009 - 10:12 AM
|
The RibbonBar sample initializes a lot of CExtCustomizeCmdScreenTip tooltips. Most buttons in the ribbon bar have screentips similar to those on your screenshot.
|
|
Robert Webb
|
Mar 16, 2009 - 10:56 PM
|
Hi, Most MFC controls have Prof-UIS equivalents, and can simply be replaced for improved skinning etc. However CPropertySheet doesn’t seem to be one of them. What is the easiest way to get a CPropertySheet with CPropertyPages skinned by Prof-UIS? If I use the obvious choice, CExtResizablePropertySheet, not everything is skinned properly, in particular the tabs. Somewhere it recommended CExtTabPageContainerWnd instead, but that can’t be substituted directly as it is not derived from CDialog and is missing DoModal() etc. Do you have a ready-to-go class I can slot in? It seems like a strange thing to be missing. Thanks, Rob.
|
|
Technical Support
|
Mar 17, 2009 - 10:14 AM
|
The CExtResizablePropertySheet and CExtResizablePropertyPage classes are designed for wizard mode property sheet only. They also work in tabbed property sheet mode with and without watermark area, but the tabbed mode well looks only if you are using 2000 or native XP paint managers. When we need a property sheet in our projects, we do the following:
1) Create a new popup dialog with OK, Cancel, Apply buttons at the bottom.
2) Rest of the dialog’s area is covered by the CExtTabPageContainerWnd window. You can create it in dialog’s OnInitDialog() virtual method.
3) Create several child dialogs, which are tab page windows. They are created as children of the CExtTabPageContainerWnd window and registered as tab pages using the CExtTabPageContainerWnd::PageInsert() method.
|
|
Robert Webb
|
Mar 16, 2009 - 8:20 PM
|
Hi, Is there a way to add or modify items on the menu that appears when you right-click on a control in the ribbon bar? I’d like to be able to tell which control was clicked and add different stuff accordingly. And I guess since I would add the same menu item for many controls, I’d like the callback when selected to also be able to tell which control was right-clicked. Thanks, Rob.
|
|
Robert Webb
|
Mar 19, 2009 - 2:11 AM
|
Thanks, CExtControlBar::g_nMsgConstructPopupMenu looks good, because it allows me to edit the existing default menus. But it can’t be used (can it?) for ribbon bar menus. However, CExtRibbonBar::OnRibbonTrackButtonContextMenu() doesn’t allow the same flexibility. The base version creates the menu and also opens the menu for tracking, so there’s no way to get in between and alter it. I want to keep the existing menus, but add an item or two. Is this not possible without first copying all the code from the base class? I really don’t want to do that.
Thanks,
Rob.
|
|
Technical Support
|
Mar 20, 2009 - 1:41 PM
|
In the case of ribbon bar, you should use the CExtRibbonBar::OnRibbonTrackButtonContextMenu() virtual method, which is invoked for context menus displayed over any button or the CExtRibbonBar::OnRibbonTrackBarContextMenu() virtual method which is invoked for other context menus. So, the CExtRibbonBar class allows you to implement completely new context menus using these virtual methods:
virtual bool OnRibbonTrackButtonContextMenu(
CExtBarButton * pTBB,
UINT nFlags,
CPoint point
);
virtual bool OnRibbonTrackBarContextMenu(
UINT nFlags,
CPoint point
);
But the CExtRibbonBar class does not have similar virtual methods invoked from the methods above for modifying created by default context menus. You was right. We think this is not a good design. So, we added two new virtual methods into the CExtRibbonBar class: virtual bool OnRibbonPrepareButtonContextMenu(
CExtPopupMenuWnd * pWndPopupMenu,
CExtBarButton * pTBB,
UINT nFlags,
CPoint point
);
virtual bool OnRibbonPrepareBarContextMenu(
CExtPopupMenuWnd * pWndPopupMenu,
UINT nFlags,
CPoint point
);
bool CExtRibbonBar::OnRibbonPrepareButtonContextMenu(
CExtPopupMenuWnd * pWndPopupMenu,
CExtBarButton * pTBB,
UINT nFlags,
CPoint point
)
{
ASSERT_VALID( this );
ASSERT_VALID( pWndPopupMenu );
ASSERT_VALID( pTBB );
pWndPopupMenu;
pTBB;
nFlags;
point;
return true;
}
bool CExtRibbonBar::OnRibbonPrepareBarContextMenu(
CExtPopupMenuWnd * pWndPopupMenu,
UINT nFlags,
CPoint point
)
{
ASSERT_VALID( this );
ASSERT_VALID( pWndPopupMenu );
pWndPopupMenu;
nFlags;
point;
return true;
}
They are invoked from the modified CExtRibbonBar::OnRibbonTrackButtonContextMenu() and CExtRibbonBar::OnRibbonTrackBarContextMenu() methods: bool CExtRibbonBar::OnRibbonTrackButtonContextMenu(
CExtBarButton * pTBB,
UINT nFlags,
CPoint point
)
{
ASSERT_VALID( this );
ASSERT_VALID( pTBB );
nFlags;
if( GetSafeHwnd() == NULL )
return false;
if( pTBB->IsKindOf( RUNTIME_CLASS( CExtRibbonButtonFile ) )
|| pTBB->IsKindOf( RUNTIME_CLASS( CExtRibbonButtonQuickAccessContentExpand ) )
|| pTBB->IsKindOf( RUNTIME_CLASS( CExtRibbonButtonTabPage ) )
|| RibbonRightButton_GetIndexOf( pTBB ) >= 0
)
return false;
CExtBarButton * pCtxTBB = NULL;
CExtRibbonButtonDialogLauncher * pDlbTBB = DYNAMIC_DOWNCAST( CExtRibbonButtonDialogLauncher, pTBB );
if( pDlbTBB != NULL )
pTBB = pDlbTBB->ParentButtonGet();
CExtRibbonButtonGroup * pGroupTBB = DYNAMIC_DOWNCAST( CExtRibbonButtonGroup, pTBB );
if( pGroupTBB != NULL )
{
for( ; pTBB != NULL; )
{
ASSERT_VALID( pGroupTBB );
CExtBarButton * pTBB2 = pGroupTBB->ParentButtonGet();
if( pTBB2 == NULL )
break;
ASSERT_VALID( pTBB2 );
pGroupTBB = DYNAMIC_DOWNCAST( CExtRibbonButtonGroup, pTBB2 );
if( pGroupTBB == NULL )
break;
}
if( pGroupTBB == NULL )
return false;
pCtxTBB = pGroupTBB;
}
else
{
if( pTBB->ChildButtonGetCount() != 0 )
return false;
pCtxTBB = pTBB;
}
ASSERT( pCtxTBB != NULL );
ASSERT_VALID( pCtxTBB );
ClientToScreen( &point );
DWORD dwTrackFlags = TPMX_OWNERDRAW_FIXED|TPMX_COMBINE_NONE|TPMX_RIBBON_MODE|TPMX_NO_HIDE_RARELY|TPMX_FORCE_NO_ANIMATION;
CExtPopupMenuWnd * pPopup = CExtPopupMenuWnd::InstantiatePopupMenu( GetSafeHwnd(), RUNTIME_CLASS(CExtPopupMenuWnd), this );
if( ! pPopup->LoadMenu( GetSafeHwnd(), IDR_EXT_RIBON_CTX_MENU, true, true ) )
{
delete pPopup;
return false;
}
bool bQaButton = ( RibbonQuickAccessButton_GetIndexOf( pCtxTBB ) >= 0 ) ? true : false;
bool bRibbonQuickAccessBarIsAboveTheRibbon = RibbonQuickAccessBar_AboveTheRibbonGet();
INT nIndexInQA = RibbonQuickAccessButton_GetIndexOf( pCtxTBB );
INT nIndex, nCount = pPopup->ItemGetCount();
for( nIndex = 0; nIndex < nCount; )
{
UINT nCmdID = pPopup->ItemGetCmdID( nIndex );
switch( nCmdID )
{
case ID_EXT_RIBBON_QATB_ADD_TO:
if( nIndexInQA >= 0 )
break;
pPopup->ItemInsert( 0, nIndex + 1 );
nIndex += 2;
nCount ++;
continue;
case ID_EXT_RIBBON_QATB_REMOVE_FROM:
if( nIndexInQA < 0 )
break;
pPopup->ItemInsert( 0, nIndex + 1 );
nIndex += 2;
nCount ++;
continue;
case ID_EXT_RIBBON_MINIMIZE:
{
CExtPopupMenuWnd::MENUITEMDATA & mi = pPopup->ItemGetInfo( nIndex );
mi.SetNoCmdUI( true );
mi.Enable( true );
mi.Check( ! RibbonPage_ExpandedModeGet() );
if( nIndex > 0 )
{
pPopup->ItemInsert( ID_SEPARATOR, nIndex );
nIndex ++;
}
nIndex ++;
continue;
}
break;
case ID_EXT_RIBBON_QATB_PLACE_BELOW:
if( bRibbonQuickAccessBarIsAboveTheRibbon && bQaButton )
{
nIndex ++;
continue;
}
break;
case ID_EXT_RIBBON_QATB_PLACE_ABOVE:
if( ( ! bRibbonQuickAccessBarIsAboveTheRibbon ) && bQaButton )
{
nIndex ++;
continue;
}
break;
case ID_EXT_RIBBON_QATB_RESET:
case ID_EXT_RIBBON_QATB_CUSOMIZE:
nIndex ++;
continue;
}
pPopup->ItemRemove( nIndex );
nCount --;
}
m_nHelperCtxIndexQA = _GetIndexOf( pCtxTBB );
pPopup->m_hWndNotifyMenuClosed = GetSafeHwnd();
if( ! OnRibbonPrepareButtonContextMenu( pPopup, pTBB, nFlags, point ) )
{
delete pPopup;
return false;
}
if( pPopup->ItemGetCount() == 0 )
{
delete pPopup;
return false;
}
if( ! pPopup->TrackPopupMenu( dwTrackFlags, point.x, point.y ) )
{
delete pPopup;
return false;
}
return true;
}
bool CExtRibbonBar::OnRibbonTrackBarContextMenu(
UINT nFlags,
CPoint point
)
{
ASSERT_VALID( this );
nFlags;
if( GetSafeHwnd() == NULL )
return false;
ClientToScreen( &point );
if( RibbonLayout_IsFrameIntegrationEnabled()
&& RibbonQuickAccessBar_AboveTheRibbonGet()
&& (! m_rcHelperEmbeddedCaptionText.IsRectEmpty() )
&& m_rcHelperEmbeddedCaptionText.PtInRect( point )
)
return false;
else if( GetParent()->SendMessage( WM_NCHITTEST, 0, MAKELPARAM( point.x, point.y ) ) != HTCLIENT )
return false;
DWORD dwTrackFlags = TPMX_OWNERDRAW_FIXED|TPMX_COMBINE_NONE|TPMX_RIBBON_MODE|TPMX_NO_HIDE_RARELY|TPMX_FORCE_NO_ANIMATION;
CExtPopupMenuWnd * pPopup = CExtPopupMenuWnd::InstantiatePopupMenu( GetSafeHwnd(), RUNTIME_CLASS(CExtPopupMenuWnd), this );
if( ! pPopup->LoadMenu( GetSafeHwnd(), IDR_EXT_RIBON_CTX_MENU, true, true ) )
{
delete pPopup;
return false;
}
bool bRibbonQuickAccessBarIsAboveTheRibbon = RibbonQuickAccessBar_AboveTheRibbonGet();
INT nIndex, nCount = pPopup->ItemGetCount();
for( nIndex = 0; nIndex < nCount; )
{
UINT nCmdID = pPopup->ItemGetCmdID( nIndex );
switch( nCmdID )
{
case ID_EXT_RIBBON_MINIMIZE:
{
CExtPopupMenuWnd::MENUITEMDATA & mi = pPopup->ItemGetInfo( nIndex );
mi.SetNoCmdUI( true );
mi.Enable( true );
mi.Check( ! RibbonPage_ExpandedModeGet() );
if( nIndex > 0 )
{
pPopup->ItemInsert( ID_SEPARATOR, nIndex );
nIndex ++;
}
nIndex ++;
continue;
}
break;
case ID_EXT_RIBBON_QATB_PLACE_BELOW:
if( bRibbonQuickAccessBarIsAboveTheRibbon )
{
nIndex ++;
continue;
}
break;
case ID_EXT_RIBBON_QATB_PLACE_ABOVE:
if( ! bRibbonQuickAccessBarIsAboveTheRibbon )
{
nIndex ++;
continue;
}
break;
case ID_EXT_RIBBON_QATB_RESET:
case ID_EXT_RIBBON_QATB_CUSOMIZE:
nIndex ++;
continue;
} // switch( nCmdID )
pPopup->ItemRemove( nIndex );
nCount --;
} // for( nIndex = 0; nIndex < nCount; )
pPopup->m_hWndNotifyMenuClosed = GetSafeHwnd();
if( ! OnRibbonPrepareBarContextMenu( pPopup, nFlags, point ) )
{
delete pPopup;
return false;
}
if( pPopup->ItemGetCount() == 0 )
{
delete pPopup;
return false;
}
if( ! pPopup->TrackPopupMenu( dwTrackFlags, point.x, point.y ) )
{
delete pPopup;
return false;
}
return true;
}
The and CExtRibbonBar::OnRibbonTrackButtonContextMenu() and CExtRibbonBar::OnRibbonTrackBarContextMenu() allow you to modify created by default context menus. You can return false from these methods to cancel context menus.
|
|
Robert Webb
|
Mar 19, 2009 - 6:36 PM
|
Further to my above message, you could extend Prof-UIS to make modification of ribbon bar context menus rather easily in CExtRibbonBar::OnRibbonTrackButtonContextMenu() by adding a call to a new virtual function like this (with some surrounding context):
case ID_EXT_RIBBON_QATB_RESET:
case ID_EXT_RIBBON_QATB_CUSOMIZE:
nIndex ++;
continue;
} // switch( nCmdID )
pPopup->ItemRemove( nIndex );
nCount --;
} // for( nIndex = 0; nIndex < nCount; )
m_nHelperCtxIndexQA = _GetIndexOf( pCtxTBB );
////////////////////////////////////////////////////////////
// Call a new virtual function here. Something like this:
// if (!OnRibbonContextMenuModify(pPopup, pTBB, nFlags, point))
// {
// delete pPopup;
// return false;
// }
////////////////////////////////////////////////////////////
pPopup->m_hWndNotifyMenuClosed = GetSafeHwnd();
if( ! pPopup->TrackPopupMenu(
dwTrackFlags,
point.x,
point.y
)
)
{
delete pPopup;
return false;
}
return true; The new function could return false to disable the menu, or true otherwise. Similar code would have to be added to CExtRibbonBar::OnRibbonTrackBarContextMenu(). I’d suggest just using the same new virtual function with the pTBB arg set to NULL. Any chance you could add this? Or explain how I should be doing it (modifying the existing ribbon context menus). Rob. PS. You desperately need to ditch whatever software you use for this forum and use something less frustrating like phpBB!
|
|
Technical Support
|
Mar 20, 2009 - 2:15 PM
|
You wrote "the new function could return false to disable the menu, or true otherwise". Yes, that’s true. This design is somehow supererogatory. The OnRibbon***ContextMenu***Modify*** (or OnRibbon***ContextMenu***Prepare*** ) methods does not need to return any flag at all. Such methods can simply remove all the popup menu items using the CExtPopupMenuWnd::ItemRemove() method and, as result, context menu will not be displayed. But, according to our experience, customers often prefer to just to return true or false from similar virtual methods. Please consider this explanation is not a final answer in this thread - we are waiting for your reply.
P.S. We merged two types of forums into one and running on this mixed forum system:
1) One is PhpBB like plain, but with message indents inside each thread. It’s loved by indexer bots. It’s displayed by default forum view.
2) Second one is what we really love. It’s tree like discussion where you can see what is related to what. Please try to switch to this tree view and let us know what you think about it.
|
|
Robert Webb
|
Mar 23, 2009 - 1:39 AM
|
Your changes look good. Basically the same as the hack I made to my local copy. So I hope it will be part of the next official release. Regarding the forum, I see no way to obtain a tree view. Either way, there are many problems still in terms of usability. It is NOT like phpBB. I posted about this before: http://www.prof-uis.com/prof-uis/tech-support/support-forum/suggestion-switch-to-a-more-usable-forum-like-phpbb-62439.aspx#@lt;/p>
But techical support did not reply to that one. Another really difficult thing when editing messages here is highlighting. I often spend ages trying to get the right words highlighted the right way and end up giving up. Eg if I highlight some text and select a different style, it isn’t applied. If I have the cursor after a block of one style, select a different style, then start typing, it never comes out in the right style. Etc, etc, etc. Just switch to phpBB and everyone will be happy. Rob.
|
|
Technical Support
|
Mar 17, 2009 - 10:16 AM
|
Prof-UIS allows to modify or re-create any of the built in popup menus displayed over different control bars and frame window areas. For instance the ProfStudio sample application completely recreates the context menus displayed over control bars, main frame window and menus displayed from toolbar chevron button. This is possible via handling the CExtControlBar::g_nMsgConstructPopupMenu registered message like demonstrated in the CMainFrame::OnConstructPopupMenuCB() method in the ProfStudio sample application. The CExtControlBar::g_nMsgConstructPopupMenu registered message is sent twice. First time it allows to construct entire menu from scratch. Second time it allows to modify constructed by default menu. If you need simply to hide some Prof-UIS based control bar from the context menus displayed over bars and frame, then you simply should set the bar’s CExtControlBar::m_bAppearInDockSiteControlBarPopupMenu property to false . If you are using dynamic resizable control bars and you need to modify menu displayed over dynamic bar’s caption or from its Window Options caption button, then you should create and you own CExtDynamicControlBar -derived class which implements the CExtDynamicControlBar::OnInitDbsMenu() virtual method. The CExtRibbonBar control uses its specific context menus. To modify the ribbon bar’s context menus you should override the CExtRibbonBar::OnRibbonTrackButtonContextMenu() virtual method.
|
|
Ulrich Heinicke
|
Mar 16, 2009 - 4:28 PM
|
Hi, i have some question for the grid. 1. If there are two outer rows at the top and one outer column at both side, then the edge wil be draw with 2 lines in the middle. Why? 2. How can i join these edge into one big cell (without the lines in the middle)? 3. It is possible to join the outer rows with the edge like this? This grid use the Grid from CodeProject, but i will make the same with your grid. Thanks Ulrich
|
|
Technical Support
|
Mar 18, 2009 - 7:22 AM
|
We are sorry, we wrote join command for two columns and one row:
m_wndGrid.GridCellJoinSet( CSize( 2, 1 ), 0L, 0L, -1, -1, true, true, true );
But we really meant one column and two rows: m_wndGrid.GridCellJoinSet( CSize( 1, 2 ), 0L, 0L, -1, -1, true, true, true );
Please note, both grid cells inside this joined cell areas should be initialized. The grid cell objects can be any grid cell type based on the CExtGCJ template class ( CExtGridCellHeader , CExtGridCellString CExtGridCellEx ).
|
|
Technical Support
|
Mar 17, 2009 - 10:16 AM
|
The incorrect borders of the header grid cells in the outer corner areas of the grid control is the known issue of the Office 2007 paint managers. We are working on it.
Yes it’s possible to join grid cells inside any outer area of the grid window: any side area, any corner area. Please note, the joined cell area must have all the grid cells initialized under joined area. You have two corner grid cells in the top left corner area of the grid window. To join them:
CExtGridWnd & wndGrid = . . .
wndGrid.GridCellJoinSet( CSize(1,2), 0, 0, -1, -1 );
Please take a look at the following test project: http://www.prof-uis.com/download/forums/TestCellJoin-everywhere.zip
|
|
Ulrich Heinicke
|
Mar 17, 2009 - 4:06 PM
|
Thanks for joining the edge. But there is one question left. If you have one outer column left and one outer row top, then i want to join the top left edge with the first outer row cell at the top. I initialize the edge and the first outer row cell. Then i write:
m_wndGrid.GridCellJoinSet(CSize(2, 1), 0L, 0L, -1, -1, true, true, true); But the GridCellJoinTest failed. Please tell me how i can do this. Thanks Ulrich
|
|
Gevork Odabashyan
|
Mar 16, 2009 - 8:00 AM
|
Dear support,
In our projects we need a full featured edit control which allows to input data in different numeric formats for integers and floating point values.
It would be very nice to use regular expressions to describe input data format (for digit grouping, decimals separators etc.) Currently we use modified classes from:
http://www.codeproject.com/KB/cpp/cpflexmaskeditbox.asp#@lt;br /> but it would be suitable to have such control in prof-UIS. Unfortunately the new CExtEditMasked control does not offer such posibility.
Can we expect that such control appears in the near future in the Prof-UIS?
If the creation of the universal control requires a lot of time it would be
preferable to have at least an element for editing of numbers with digit grouping option
and adjustable fractional part in the nearest versions.
|
|
Technical Support
|
Mar 16, 2009 - 1:35 PM
|
We are working on two versions of the new editor classes with input validation: currency and numeric editors. Both use data format descriptions from Windows locale settings for input validation. We want them to be used in appropriate grid cell classes. The currency editor is almost finished. The numeric editor is not finished yet. If you have no time to wait for our new classes, then you can use any editor class from sites like www.codeproject.com. We believe if you change the based class of such third party validation editors from the MFC’s CEdit class to the CExtEdit class from Prof-UIS, then you will get the editor like you need.
Very unfortunately, the URL link in your message is broken.
|
|
Offer Har
|
Mar 14, 2009 - 8:18 AM
|
|
|
Technical Support
|
Mar 15, 2009 - 8:39 AM
|
Thank you for reporting this issue. To fix it, please update the source code for the following method:
void CExtNcFrameImpl::stat_MDI_TileEWL( // explicit window list based version
HWND hWndMdiClient,
CList < HWND, HWND > & _list,
bool bHorizontal
)
{
ASSERT( hWndMdiClient != NULL && ::IsWindow( hWndMdiClient ) );
INT nCount = INT( _list.GetCount() );
if( nCount == 0 )
return;
ShowScrollBar( hWndMdiClient, SB_BOTH, FALSE );
CRect rcClient;
GetClientRect( hWndMdiClient, &rcClient );
CList < HWND, HWND > _listWindowsToSkip;
rcClient.bottom -= stat_MDI_ArrangeIconic( hWndMdiClient, _listWindowsToSkip );
CSize sizeClient = rcClient.Size();
INT nRest = 1;
INT nIndexX = (INT)::sqrt( (double)nCount );
INT nIndexY = nIndexX;
if( nIndexY == 1 )
{
if( bHorizontal )
nIndexY = nCount;
else
nIndexX = nCount;
}
else
{
for( ; true; )
{
nRest = nCount - nIndexY * ( nIndexX - 1 );
if( bHorizontal )
{
if( ( nRest - nIndexX ) >= nIndexY )
nIndexY ++;
else
break;
}
else
{
if( ( nRest - nIndexY ) >= nIndexX )
nIndexX ++;
else
break;
}
}
}
CSize sizeChild( sizeClient.cx / nIndexX, sizeClient.cy / nIndexY );
HDWP hDWP = ::BeginDeferWindowPos( nCount );
POSITION pos = _list.GetHeadPosition();
INT nWalkIndex = 0, nX, nY;
for( nX = 0, nY = 0; nX < nCount; nX ++ )
{
ASSERT( pos != NULL );
HWND hWnd = _list.GetNext( pos );
ASSERT( hWnd != NULL && ::IsWindow( hWnd ) );
CPoint ptTopLeft( 0, 0 );
if( bHorizontal )
{
ptTopLeft.x = ( nWalkIndex - nY * nIndexX ) * sizeChild.cx;
ptTopLeft.y = nY * sizeChild.cy;
if( ( ( nWalkIndex % nIndexX ) == ( nIndexX - 1 ) )
&& ( nY < ( nIndexY - 1 ) )
)
nY ++;
}
else
{
ptTopLeft.x = nY * sizeChild.cx;
ptTopLeft.y = ( nWalkIndex - nY * nIndexY ) * sizeChild.cy;
if( ( ( nWalkIndex % nIndexY ) == ( nIndexY - 1 ) )
&& ( nY < ( nIndexX - 1 ) )
)
nY ++;
}
hDWP =
::DeferWindowPos(
hDWP, hWnd, NULL,
ptTopLeft.x, ptTopLeft.y, sizeChild.cx, sizeChild.cy,
SWP_NOACTIVATE|SWP_NOZORDER
);
if( bHorizontal )
{
if( nY == ( nIndexY - 1 ) )
sizeChild.cx = sizeClient.cx / nRest;
}
else
{
if( nY == ( nIndexX - 1 ) )
sizeChild.cy = sizeClient.cy / nRest;
}
nWalkIndex ++;
}
::EndDeferWindowPos( hDWP );
}
|
|
Offer Har
|
Mar 13, 2009 - 6:37 AM
|
Dear Support, We have applications whose main frame derive from CExtNCW<CMDIFrameWnd> . The WInodws menu in these application contain the commands ID_WINDOW_TILE_HORZ and ID_WINDOW_TILE_VERT . For some reason these two are switched - the horizontal command tiles the windows vertical and the vertical command tiles them horizontal. If we repalace CExtNCW<CMDIFrameWnd> with CMDIFrameWnd this problem disappear. Do you have any idea what can cause this behavior? Thanks, Ron.
|
|
Technical Support
|
Mar 15, 2009 - 8:39 AM
|
Thank you for reporting this issue. We will debug it and provide you with a fix.
|
|
Offer Har
|
Mar 15, 2009 - 8:49 AM
|
Thank you, now the QA will be off my back
|
|
tera tera
|
Mar 13, 2009 - 2:58 AM
|
Hello. I want to display a background of selection MDITAB with red.
The thing of the non-selection wants to display it with blue.
|
|
Technical Support
|
Mar 13, 2009 - 3:33 PM
|
The MDI tab control displayed on your screen shot is based on the one note tab control. The LPARAM values attached to its tab items are HWND handles of MDI child frame windows. So, you can use the CExtTabWnd::ItemFindByLParam() method to find the tab item index which corresponds to appropriate MDI child frame window. Then you should use the CExtTabOneNoteWnd::ItemGet() method to get the pointer to the CExtTabOneNoteWnd::TAB_ITEM_INFO_ONENOTE data structure which describes the tab item inside the One Note tabs. The CExtTabOneNoteWnd::TAB_ITEM_INFO_ONENOTE::GetColorBkLight() and CExtTabOneNoteWnd::TAB_ITEM_INFO_ONENOTE::GetColorBkDark() methods return the colors of the One Note tab item.
|
|