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 |
|
Lars Mohr
|
Jun 10, 2010 - 8:51 AM
|
Dear Support, is there a way to catch the button pressed signal without to derivate from the CExtGridCell class? Maybe with subclassing of the CExtGridWnd ? Thanks a lot!
|
|
Technical Support
|
Jun 11, 2010 - 8:22 AM
|
The CExtGridWnd::OnGbwAnalyzeCellKeyEvent() virtual method is invoked for keyboard event processing. It invokes the CExtGridCell::OnKey() virtual method of the focused grid cell(CExtGridBaseWnd::FocusGet() ). You can override any of these methods.
|
|
Rado Manzela
|
Jun 10, 2010 - 4:49 AM
|
Is it possible to have splitter in CExtResizableDialog-derived dialog? I need to split resizable dialogs into 2 parts, one containing big grid and other part various anchored controls. Thank you.
|
|
Technical Support
|
Jun 10, 2010 - 9:00 AM
|
Yes of course. Just create a CExtSplitterWnd window as a child of your dialog window, then create several splitter pane windows of any type as children of the CExtSplitterWnd window. The CExtShellDialogFile class implements a themed file dialog. It creates a shell tree and shell list view controls inside the splitter.
|
|
Rado Manzela
|
Jun 9, 2010 - 8:19 AM
|
I’m using CExtPanelControlBar which contains CExtResizableDialog - derived dialog. It looks good in all themes except VS2010 theme, where you can see flat background of dialog surrounded by themed control bar’s margins. How can I fix it? Is it possible to have "transparent" background on dialog to see controlbar’s background only? Is it possible to have the same background in my dialog inserted in toolbar like your UI selection toolbar? Thank you.
|
|
Technical Support
|
Jun 10, 2010 - 9:00 AM
|
Could you send us a screen shot of your panel control bar with a child dialog to the support mail box at this web site?
|
|
Offer Har
|
Jun 9, 2010 - 8:17 AM
|
Dear Support, We have an application that crashes on exit. This is the location in WindowProc of the dialog:
bool bUpdateBarsOnThisMsg = false;
if( m_bEnabledControlBarUpdate )
{
CWinApp * pApp = AfxGetApp();
ASSERT( pApp != NULL );
BOOL bIdleMsg = pApp->IsIdleMessage(
#if _MFC_VER < 0x700
&pApp->m_msgCur
#else
&(::AfxGetThreadState()->m_msgCur)
#endif
);
if( bIdleMsg )
bUpdateBarsOnThisMsg = true;
} Because the application terminates, pApp is NULL , and the rest causes the crash. Why does this happens? The message code handles in the WindowProc is 31 ( WM_CANCELMODE ) Please help... Thanks, Ron. This is the call-stack:
ntdll.dll!7c90120e()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
msvcr80d.dll!_CrtDbgBreak() Line 89 C
msvcr80d.dll!_VCrtDbgReportA(int nRptType=2, const char * szFile=0x01e75e60, int nLine=370, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x00128cac) Line 290 C
msvcr80d.dll!_CrtDbgReportV(int nRptType=2, const char * szFile=0x01e75e60, int nLine=370, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x00128cac) Line 300 + 0x1d bytes C
msvcr80d.dll!_CrtDbgReport(int nRptType=2, const char * szFile=0x01e75e60, int nLine=370, const char * szModule=0x00000000, const char * szFormat=0x00000000, ...) Line 317 + 0x1d bytes C
mfc80d.dll!AfxAssertFailedLine(const char * lpszFileName=0x01e75e60, int nLine=370) Line 25 + 0x14 bytes C++
ProfUIS287md.dll!CExtResizableDialog::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 370 + 0x15 bytes C++
ProfUIS287md.dll!CExtNCW<CExtResizableDialog>::WindowProc(unsigned int message=31, unsigned int wParam=0, long lParam=0) Line 608 + 0x14 bytes C++
mfc80d.dll!AfxCallWndProc(CWnd * pWnd=0x3612c534, HWND__ * hWnd=0x00142824, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 240 + 0x1c bytes C++
mfc80d.dll!AfxWndProc(HWND__ * hWnd=0x00142824, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 389 C++
mfc80d.dll!AfxWndProcBase(HWND__ * hWnd=0x00142824, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 411 + 0x15 bytes C++
user32.dll!7e418734()
user32.dll!7e418816()
user32.dll!7e428ea0()
user32.dll!7e428eec()
ntdll.dll!7c90e473()
user32.dll!7e429841()
user32.dll!7e42497b()
user32.dll!7e43a956()
msvcr80d.dll!_output_s_l(_iobuf * stream=0x00142824, const char * format=0x00189c78, localeinfo_struct * plocinfo=0x00189fa0, char * argptr=0x00012012) Line 1166 + 0x17 bytes C++
user32.dll!7e4664a2()
user32.dll!7e450877()
user32.dll!7e45082f()
msvcr80d.dll!__crtMessageBoxA(const char * lpText=0x001295e8, const char * lpCaption=0x102d315c, unsigned int uType=73746) Line 168 + 0x13 bytes C
msvcr80d.dll!__crtMessageWindowA(int nRptType=2, const char * szFile=0x01e75e60, const char * szLine=0x0012b65c, const char * szModule=0x00000000, const char * szUserMessage=0x0012a65c) Line 420 + 0x16 bytes C
msvcr80d.dll!_VCrtDbgReportA(int nRptType=2, const char * szFile=0x01e75e60, int nLine=370, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x0012f6f0) Line 420 + 0x28 bytes C
msvcr80d.dll!_CrtDbgReportV(int nRptType=2, const char * szFile=0x01e75e60, int nLine=370, const char * szModule=0x00000000, const char * szFormat=0x00000000, char * arglist=0x0012f6f0) Line 300 + 0x1d bytes C
msvcr80d.dll!_CrtDbgReport(int nRptType=2, const char * szFile=0x01e75e60, int nLine=370, const char * szModule=0x00000000, const char * szFormat=0x00000000, ...) Line 317 + 0x1d bytes C
mfc80d.dll!AfxAssertFailedLine(const char * lpszFileName=0x01e75e60, int nLine=370) Line 25 + 0x14 bytes C++
ProfUIS287md.dll!CExtResizableDialog::WindowProc(unsigned int message=20, unsigned int wParam=16863527, long lParam=0) Line 370 + 0x15 bytes C++
ProfUIS287md.dll!CExtNCW<CExtResizableDialog>::WindowProc(unsigned int message=20, unsigned int wParam=16863527, long lParam=0) Line 608 + 0x14 bytes C++
mfc80d.dll!AfxCallWndProc(CWnd * pWnd=0x3612c534, HWND__ * hWnd=0x00142824, unsigned int nMsg=20, unsigned int wParam=16863527, long lParam=0) Line 240 + 0x1c bytes C++
mfc80d.dll!AfxWndProc(HWND__ * hWnd=0x00142824, unsigned int nMsg=20, unsigned int wParam=16863527, long lParam=0) Line 389 C++
mfc80d.dll!AfxWndProcBase(HWND__ * hWnd=0x00142824, unsigned int nMsg=20, unsigned int wParam=16863527, long lParam=0) Line 411 + 0x15 bytes C++
user32.dll!7e418734()
user32.dll!7e418816()
user32.dll!7e428ea0()
user32.dll!7e428eec()
ntdll.dll!7c90e473()
user32.dll!7e42b1a8()
mfc80d.dll!CWnd::DestroyWindow() Line 993 + 0xd bytes C++
> mfc80d.dll!CStatic::~CStatic() Line 33 C++
ProfUIS287md.dll!CExtLabel::~CExtLabel() Line 77 + 0x7a bytes C++
UIEventLog.dll!CEventLogPopupDlg::~CEventLogPopupDlg() Line 30 + 0x11 bytes C++
|
|
Technical Support
|
Jun 11, 2010 - 8:19 AM
|
The CWnd::DestroyWindow() method is virtual and it can be overridden. But this is not important. The really important thing is that the CWnd::DestroyWindow() method invokes the ::DestroyWindow() Win32 API which causes the WM_DESTROY message be sent to the window procedure. The WM_DESTROY message is passed through the WindowProc() virtual method and the OnDestroy() handler method. Then the WM_NCDESTROY message is delivered to the window procedure. This is specific message. It’s not passed through the WindowProc() virtual method. MFC uses the PostNcDestroy() virtual method for notifying about the WM_NCDESTROY message. Both WM_DESTROY and WM_NCDESTROY messages are sent to each window only once.
Please take a look at the bottom of the call stack. It looks like some label window destroys itself in the destructor. This is not in style of MFC. Window handles should be destroyed before the C++ objects become deleted. The C++ objects must not destroy subclassed window handles in the destructor code.
|
|
Technical Support
|
Jun 10, 2010 - 10:26 AM
|
The AfxGetApp() API must never return NULL if you have no memory damages, if a regular DLL manages MFC state switching correctly and if your code destroys all the windows before exiting process. Please provide us with more information about type of your project and about when this situation occur? Please also set the AfxGetApp() as next statement in debugger and try to debug what’s happened inside and why such bad return value is generated.
|
|
Offer Har
|
Jun 10, 2010 - 10:33 AM
|
Hi, This is simple MDI application, nothing special about it. The thing is that I know that this is called when the application is on its way out. What I don’t understand why the destructor of the dialog, calls DestroyWindow - the destructor was called after the main window was already destroyed, and now the application is just freeing its memory. Shouldn’t the DestroyWindow be called from OnDestroy of the dialog? I cannot run the application now, as I’m not in the office, but as I recall the rest of the stack was at the very end of the process, and no other windowing functions were in the stack, only freeing of memory. Thanks, Ron.
|
|
Offer Har
|
Jun 10, 2010 - 10:39 AM
|
OK... the DestroyWindow is MFC code... not yours.
However, a few lines up the stack, your function start to appear -
ProfUIS287md.dll!CExtResizableDialog::WindowProc(unsigned int message=20, unsigned int wParam=16863527, long lParam=0) Line 370 + 0x15 bytes C++ ProfUIS287md.dll!CExtNCW<CExtResizableDialog>::WindowProc(unsigned int message=20, unsigned int wParam=16863527, long lParam=0) Line 608 + 0x14 bytes C++
This I don’t understand - how come that from the DestroyWindow the CExtResizableDialog’ WindowProc is called. Any ideas?
|
|
Offer Har
|
Jun 8, 2010 - 11:52 AM
|
Dear Support, I am trying to add a button to a toolbar from the code using InsertButton. The command is not known in advance, so there is no handling for it in the command manager. What I get is an empty button. How can I add image, tooltip etc to the button? Thanks, Ron.
|
|
Technical Support
|
Jun 8, 2010 - 12:08 PM
|
Toolbar buttons use a command manager to get text, tooltip text, status tip text and an icon. They do not have a visual look without the command manager. You can allocate commands in the command manager (g_CmdManager->CmdAllocPtr() ) and load texts and icons. The command manager can provide you with dynamic command identifiers which are not intersected with other commands. But alternatively you can implement your own toolbar buttons containing icons and texts like demonstrated in the FunnyBars sample application.
|
|
Lars Mohr
|
Jun 7, 2010 - 12:22 PM
|
|
|
Technical Support
|
Nov 3, 2010 - 10:06 AM
|
We implemented only small improvements of the browse for folder dialog in Prof-UIS 2.91. The shell namespace scanning algorithms are still in development.
|
|
Lars Mohr
|
Nov 2, 2010 - 10:33 AM
|
Dear Support Team, is there any progress on this topic? Maybe in Version 2.91?
|
|
Technical Support
|
Jun 11, 2010 - 8:23 AM
|
This task is still under development.
|
|
Lars Mohr
|
Jun 9, 2010 - 6:18 AM
|
|
|
Offer Har
|
Jun 6, 2010 - 10:17 PM
|
Dear Support, I am trying to remove a menu from the main menu at run-time by removing its button like this: m_wndMenuBar.RemoveButton(0); If I put this at the end of the OnCreate it does not work, however, if I put it in the message handling of CExtPopupMenuWnd::g_nMsgPrepareMenu it does. How can I make the menu hidden at initialization? Thanks, Ron.
|
|
Technical Support
|
Jun 7, 2010 - 6:44 AM
|
The CExtMenuControlBar menu bar component is an improved version of the CExtToolControlBar toolbar component. The menu bar buttons are the CExtBarButton toolbar buttons. You can use the CExtToolControlBar::RemoveButton() method for removing menu bar’s buttons. You should recompute menu bar parent frame’s layout to see changes (pMenuBar->GetParentFrame()->RecalcLayout() ). If you implemented the CExtMenuControlBar::_UpdateMenuBar() virtual method for building menu bar’s buttons, then your method should know which buttons it should re-initialize.
|
|
Offer Har
|
Jun 5, 2010 - 1:57 AM
|
Dear Support,
I would like to have the main menu be completely constructed at run-time and not from resource. Is this possible using Prof-UIS menus? Is there any example you can provide me?
Thanks,
Ron.
|
|
Technical Support
|
Jun 7, 2010 - 1:31 AM
|
Please override the CExtMenuControlBar::_UpdateMenuBar() virtual method. The CExtMenuControlBar::_UpdateMenuBar() method takes the content of a menu bar from Win32 a menu tree. Your method should do the same using your menu description data structures. Please provide us with more information about how the menus are described in your app?
|
|
Rado Manzela
|
Jun 4, 2010 - 5:38 AM
|
Please try to run SDI dynamic bar sample. Then click to header of some bar which is set as tabbed document and hold the click. Start to move cursor to left very slowly. In some UI themes at 6th pixel the bar disappears. In other themes it creates 2 partially drawn floating bars. When you move it to next pixel, everything is fixed. But when you release left button at 6th pixel in themes where the bar is hidden, it stays hidden. Can you fix it please? Thank you.
|
|
Technical Support
|
Jun 10, 2010 - 9:01 AM
|
Thank you for reporting this issue. You can fix it by updating the source code for the following method: bool CExtDynamicControlBar::OnStartDraggingDocumentTabItem(
CExtTabWnd * pWndTab,
LONG nTabItemIndex
)
{
ASSERT( this != NULL );
ASSERT_VALID( pWndTab );
pWndTab;
nTabItemIndex;
if( ! m_bEnableDndDocumentTabs )
return false;
if( ! _DraggingIsEnabled( this ) )
return true;
CPoint point;
if( ! ::GetCursorPos( &point ) )
return false;
if( ! BarStateSet( __EDBS_DOCKED, false ) )
{
ASSERT( FALSE );
return true;
}
bool bShowContentWhenDragging = _IsShowContentWhenDragging();
CPoint ptFloat( point );
ptFloat.x -= 15;
ptFloat.y -= 45;
ASSERT_VALID( m_pDockSite );
m_pDockSite->ShowControlBar( this, TRUE, TRUE );
CExtControlBar * pFloatBar = this;
CFrameWnd * pParentFrame = GetParentFrame();
ASSERT( pParentFrame != NULL );
if( ! pParentFrame->IsKindOf( RUNTIME_CLASS(CExtMiniDockFrameWnd) ) )
{
FloatControlBar( ptFloat );
pParentFrame = GetParentFrame();
}
else
{
CExtDynControlBar * pDynBar = _GetNearestDynamicContainer();
for( ; pDynBar != NULL; pDynBar = pDynBar->_GetNearestDynamicContainer() )
pFloatBar = pDynBar;
pFloatBar->FloatControlBar( ptFloat );
}
pParentFrame->ShowWindow( SW_SHOWNA );
pParentFrame->DelayRecalcLayout();
pParentFrame->SendMessage( WM_IDLEUPDATECMDUI );
HWND hWndOwn = m_hWnd;
if( pFloatBar != this )
{
m_pDockSite->ShowControlBar( pFloatBar, TRUE, TRUE );
pFloatBar->OnRepositionSingleChild();
::AfxGetApp()->OnIdle( 0 );
if( ! ( ::IsWindow(hWndOwn) && CWnd::FromHandlePermanent( hWndOwn ) == this ) )
return false;
}
OnRepositionSingleChild();
CPoint ptOffset( point );
CRect rcWnd;
pFloatBar->GetWindowRect( &rcWnd );
ptOffset -= rcWnd.TopLeft();
if( m_pDockSite->GetSafeHwnd() != NULL && ( ! bShowContentWhenDragging ) )
{
ASSERT_VALID( m_pDockSite );
m_pDockSite->ShowControlBar( this, TRUE, FALSE );
}
pFloatBar->_DraggingStart( point, ptOffset );
return true;
}
|
|
Dominik Braendlin
|
Jun 4, 2010 - 1:31 AM
|
Dear Tech Support, I have to change the text of CExtRibbonNode using the method SetTextInToolbar. This works fine except that the ribbon is not getting updated at all times. What else do I need to call e.g. RecalcLayout? Could you please give an example? Thanks Adrian
|
|
Technical Support
|
Jun 7, 2010 - 11:18 AM
|
The CExtRibbonPage::Ribbon_UpdateLayout() method recomputes the inner layout of the ribbon bar without recomputing layout of entire frame window.
|
|
Rado Manzela
|
Jun 3, 2010 - 3:15 AM
|
I need to hide close buttons from dynamic bars completely. I’ve managed to hide most of them, but there is still close button when I dock 2 dynamic bars in one floating bar (it creates "ProfUIS-MiniDockFrameWnd" window). How can I disable this close button please? Thank you.
|
|
Rado Manzela
|
Jun 4, 2010 - 1:53 AM
|
|
|
Technical Support
|
Jun 3, 2010 - 10:22 AM
|
The CExtControlBar::NcButtons_HandleQueryVisibility virtual methods allow you to hide any caption button of resizable control bar in any state. You should override this method and return true if you want to control the caption visibility. The bButtonIsVisible reference flag parameter should be used for saving visibility state flag. The pNcAreaButton parameter is pointer to the caption button object. It’s the CExtBarNcAreaButtonClose object in case of X-button.
|
|
Gevork Odabashyan
|
Jun 3, 2010 - 1:12 AM
|
|
|
Gevork Odabashyan
|
Jun 8, 2010 - 2:31 AM
|
I repeat the steps to reproduce memory leaks bug.
To reproduce bug follow the next steps:
- First of all, use MDI_DynamicBars-sud.exe sample from Prof-UIS 2.89 suit.
- The next is that I use Sysinternals Process Explorer under Windows XP to analyze process properties,
but the same results can be seen with the Windows XP Task Manager.
- For more clarity, hide all dynamic bars off the sample.
- Unhide one of the dynamic bars (for example Dynamic Bar 0) and switch it to the Docking state.
Switching Dynamic Bar 0 state from Docking to Tabbed and then backward to Docking state.
In results the number of USER Objects, GDI Objects and Handlers will increase.
The number of handles increase on every switchin loop - "Docking to Tabbed - Docking".
Switching loop number USER Objects Other objects
- 274 (some start value)
1 285
2 296 similarly as a USER Objects
3 307
... and so on ...
The reasons are the next:
When moving bar from Docking to Tabbed state you every time create new CExtDynamicMDIChildWnd,
and destroy it when move bar from Tabbed state to Docking state.
Every time you created CExtDynamicMDIChildWnd you supply it with:
1. shared menu
2. large and small icons
BUT not release this objects (menu and icons ) when destroy the window.
The proper place to do this is : BOOL CExtDynamicMDIChildWnd::DestroyWindow() {...}
This are extracts from the code where described above occure:
1. .......
if( m_nMdiMenuResourceID != 0 )
{
CMenu _menu;
if( g_ResourceManager->LoadMenu( _menu, m_nMdiMenuResourceID ) )
{
ASSERT( _menu.GetSafeHmenu() != NULL );
hMenuDefault = _menu.Detach();
} // if( g_ResourceManager->LoadMenu( _menu, m_nMdiMenuResourceID ) )
} // if( m_nMdiMenuResourceID != 0 )
.....
pWndMdiChild->SetHandles(
hMenuDefault,
hAccelTable
);
.....
2. LRESULT CExtDynamicMDIChildWnd::WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
...
if( message == WM_CREATE )
{
....
if( ! m_icon.IsEmpty() )
{
SetIcon( m_icon.ExtractHICON(), FALSE ); // NEW EXCTACT ICON 2.53
SetIcon( m_icon.ExtractHICON(), TRUE ); // NEW EXCTACT ICON 2.53
} // if( ! m_icon.IsEmpty() )
}
To avoid this leaks I release menu and icon objects every time by myself with ::DestroyMenu and ::DestroyIcon functions.
|
|
Technical Support
|
Jun 8, 2010 - 11:27 AM
|
Thank you for pointing us to right direction. We added the following property into the CExtDynamicMDIChildWnd class.
HICON m_hIconExtracted;
And we modified the following methods. CExtDynamicMDIChildWnd::CExtDynamicMDIChildWnd(
CExtDynamicControlBar * pBar
)
: m_pDBS( NULL )
, m_pBar( NULL )
, m_hWndHelperBar( NULL )
, m_hIconExtracted( NULL )
{
if( pBar != NULL )
AttachBar( pBar );
}
CExtDynamicMDIChildWnd::~CExtDynamicMDIChildWnd()
{
if( m_hMenuShared != NULL )
{
::DestroyMenu( m_hMenuShared );
m_hMenuShared = NULL;
}
if( m_hAccelTable != NULL )
{
::DestroyAcceleratorTable( m_hAccelTable );
m_hAccelTable = NULL;
}
if( m_hIconExtracted != NULL )
{
::DestroyIcon( m_hIconExtracted );
m_hIconExtracted = NULL;
}
}
LRESULT CExtDynamicMDIChildWnd::WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
{
if( message == WM_SETFOCUS )
{
ASSERT( m_hWndHelperBar != NULL );
if( ::IsWindow(m_hWndHelperBar) )
{
ASSERT_VALID( m_pBar );
ASSERT( m_pBar->GetSafeHwnd() == m_hWndHelperBar );
HWND hWndChild = m_pBar->OnQueryChildHWND();
if( hWndChild != NULL
&& ::GetParent(hWndChild) == m_hWnd
)
{
if( CExtControlBar::stat_QueryFocusChangingEnabled( m_pBar, hWndChild ) )
::SetFocus( hWndChild );
}
} // if( ::IsWindow(m_hWndHelperBar) )
return 0;
} // else if( message == WM_SETFOCUS )
if( (message == WM_SYSCOMMAND && wParam == SC_CLOSE)
|| message == WM_CLOSE
)
{ // closing messages
ASSERT( m_hWndHelperBar != NULL );
if( ::IsWindow(m_hWndHelperBar) )
{
ASSERT_VALID( m_pBar );
ASSERT( m_pBar->GetSafeHwnd() == m_hWndHelperBar );
m_pBar->BarStateSet(
CExtDynamicControlBar::__EDBS_DOCUMENT,
false
);
} // if( ::IsWindow(m_hWndHelperBar) )
return 0;
} // closing messages
LRESULT lResult = CMDIChildWnd::WindowProc( message, wParam, lParam );
if( message == WM_CREATE )
{
ASSERT_VALID( m_pBar );
ASSERT( m_pBar->GetSafeHwnd() == m_hWndHelperBar );
HWND hWndChild = ::GetWindow( m_pBar->GetSafeHwnd(), GW_CHILD );
ASSERT( hWndChild != NULL );
::__EXT_MFC_SetWindowLong( hWndChild, GWL_ID, AFX_IDW_PANE_FIRST );
::SetParent( hWndChild, m_hWnd );
if( ! m_icon.IsEmpty() )
{
ASSERT( m_hIconExtracted == NULL );
m_hIconExtracted = m_icon.ExtractHICON();
if( m_hIconExtracted != NULL )
{
SetIcon( m_hIconExtracted, FALSE );
SetIcon( m_hIconExtracted, TRUE );
}
} // if( ! m_icon.IsEmpty() )
CMenu * pSysMenu = GetSystemMenu( FALSE );
if( pSysMenu != NULL )
{
ASSERT_KINDOF(CMenu, pSysMenu);
pSysMenu->EnableMenuItem(
SC_CLOSE,
MF_BYCOMMAND
| ( m_pBar->_ClosingIsEnabled( m_pBar ) ? MF_ENABLED : MF_DISABLED )
);
} // if( pSysMenu != NULL )
} // if( message == WM_CREATE )
return lResult;
}
|
|
Technical Support
|
Jun 7, 2010 - 11:20 AM
|
It would be interesting to discuss your know reasons because we didn’t clarify the source of the problem yet.
|
|
Gevork Odabashyan
|
Jun 8, 2010 - 2:41 AM
|
Sorry for the incorrect insertion point,
See the answer above in my reply "Re: Once more obout memory leaks"
|
|
Ulrich Heinicke
|
Jun 2, 2010 - 2:59 PM
|
HI, the mditab is to small to show the full icon, see picture: At the top left postion are some pixel missing. How can i stretch the tab to show all pixel? Thanks Ulrich
|
|
Ulrich Heinicke
|
Jun 3, 2010 - 1:17 PM
|
Hi, using the whidbey-tab there is the same error.
|
|
Technical Support
|
Jun 3, 2010 - 10:22 AM
|
Thank you for reporting us this issue. To fix it, please update the source code for the following method:
void CExtTabOneNoteWnd::stat_OnTabWndDrawItemOneNoteImpl(
CExtTabOneNoteWnd * pWndTabs,
CDC & dc,
CRect & rcTabItemsArea,
LONG nItemIndex,
TAB_ITEM_INFO * pTii,
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,
COLORREF clrForceTabText, // = COLORREF(-1L)
COLORREF clrForceTabBk1, // = COLORREF(-1L)
COLORREF clrForceTabBk2 // = COLORREF(-1L)
)
{
ASSERT_VALID( pWndTabs );
ASSERT_VALID( pTii );
ASSERT( dc.GetSafeHdc() != NULL );
ASSERT( pFont != NULL );
ASSERT( pFont->GetSafeHandle() != NULL );
pWndTabs;
rcTabItemsArea;
CExtCmdIcon * pIconTabItemCloseButton = pWndTabs->OnTabWndQueryItemCloseButtonShape( pTii );
CExtCmdIcon::e_paint_type_t ePaintStateITICB = (CExtCmdIcon::e_paint_type_t) pWndTabs->OnTabWndQueryItemCloseButtonPaintState( pTii );
CRect rcTabItemCloseButton( 0, 0, 0, 0 );
if( pIconTabItemCloseButton != NULL )
rcTabItemCloseButton = pTii->CloseButtonRectGet();
bool bEnabled = pTii->EnabledGet();
bool bHover = ( (!pWndTabs->_IsDND()) && pWndTabs->m_nHoverTrackingHitTest == nItemIndex ) ? true : false;
if( (pTii->GetItemStyle() & __ETWI_CENTERED_TEXT) != 0 )
bCenteredText = true;
bool bInGroupFirst = false;
if( bGroupedMode )
{
TAB_ITEM_INFO * pTiiStart = pTii->GetInGroupFirst();
ASSERT_VALID( pTiiStart );
bInGroupFirst = ( nItemIndex == pWndTabs->ItemGetIndexOf( pTiiStart ) );
}
bool bFirstVisible = true;
CExtTabWnd::TAB_ITEM_INFO * pTiiWalk = pTii->GetPrev();
for( ; pTiiWalk != NULL; pTiiWalk = pTiiWalk->GetPrev() )
{
if( pTiiWalk->VisibleGet() )
{
bFirstVisible = false;
break;
}
}
bool bFirstItem =
( bFirstVisible // nItemIndex == 0
|| ( bInGroupFirst
&& nItemIndex != pWndTabs->SelectionGet()
)
);
CRect rcItem( rcEntireItem );
CRect rcItemRgn( rcItem );
POINT arrPointsBorders[11] =
{ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
{ 0, 0 }, { 0, 0 }, { 0, 0 },
};
POINT arrPointsInnerArea[10] =
{ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
{ 0, 0 }, { 0, 0 },
};
POINT arrPointsClipArea[13] =
{ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
{ 0, 0 },
};
if( bHorz )
{
if( bTopLeft )
{
rcItemRgn.InflateRect( nItemIndex == 0 ? 0 : -1, 0, 1, 0 );
arrPointsBorders[0] = CPoint( rcItemRgn.right, rcItemRgn.bottom );
arrPointsBorders[1] = CPoint( rcItemRgn.right, rcItemRgn.top + 2 );
arrPointsBorders[2] = CPoint( rcItemRgn.right - 2, rcItemRgn.top );
arrPointsBorders[3] = CPoint( rcItemRgn.left + 5, rcItemRgn.top );
arrPointsBorders[4] = CPoint( rcItemRgn.left + 4, rcItemRgn.top + 1 );
arrPointsBorders[5] = CPoint( rcItemRgn.left + 3, rcItemRgn.top + 1 );
arrPointsBorders[6] = CPoint( rcItemRgn.left + 2, rcItemRgn.top + 2 );
arrPointsBorders[7] = CPoint( rcItemRgn.left + 1, rcItemRgn.top + 2 );
arrPointsBorders[8] = CPoint( rcItemRgn.left, rcItemRgn.top + 3 );
if( bSelected || bFirstItem )
{
arrPointsBorders[9] = CPoint( rcItemRgn.left - 15, rcItemRgn.bottom - 1 );
arrPointsBorders[10] = CPoint( rcItemRgn.left - 16, rcItemRgn.bottom - 1 );
}
else
{
arrPointsBorders[9]= CPoint( rcItemRgn.left, rcItemRgn.bottom - 1 );
arrPointsBorders[10]= arrPointsBorders[9];
}
if( bFirstVisible /*nItemIndex == 0*/ )
for( int i = 3 ; i < sizeof(arrPointsBorders)/sizeof(arrPointsBorders[0]); i++ )
arrPointsBorders[i].x += 16;
arrPointsInnerArea[0] = CPoint( rcItemRgn.right - 1, rcItemRgn.bottom );
arrPointsInnerArea[1] = CPoint( rcItemRgn.right - 1, rcItemRgn.top + 2 );
arrPointsInnerArea[2] = CPoint( rcItemRgn.right - 2, rcItemRgn.top + 1 );
arrPointsInnerArea[3] = CPoint( rcItemRgn.left + 5, rcItemRgn.top + 1 );
arrPointsInnerArea[4] = CPoint( rcItemRgn.left + 4, rcItemRgn.top + 2 );
arrPointsInnerArea[5] = CPoint( rcItemRgn.left + 3, rcItemRgn.top + 2 );
arrPointsInnerArea[6] = CPoint( rcItemRgn.left + 2, rcItemRgn.top + 3 );
arrPointsInnerArea[7] = CPoint( rcItemRgn.left + 1, rcItemRgn.top + 3 );
arrPointsInnerArea[8] = CPoint( rcItemRgn.left, rcItemRgn.top + 4 );
if( bSelected || bFirstItem )
arrPointsInnerArea[9] = CPoint( rcItemRgn.left - 14, rcItemRgn.bottom - 1 );
else
arrPointsInnerArea[9] = CPoint( rcItemRgn.left, rcItemRgn.bottom - 1 );
if( bFirstVisible /*nItemIndex == 0*/ )
for( int i = 3 ; i < sizeof(arrPointsInnerArea)/sizeof(arrPointsInnerArea[0]); i++ )
arrPointsInnerArea[i].x += 16;
arrPointsClipArea[0] = CPoint( rcItemRgn.right - 2, rcItemRgn.bottom );
arrPointsClipArea[1] = CPoint( rcItemRgn.right - 2, rcItemRgn.top + 2 );
arrPointsClipArea[2] = CPoint( rcItemRgn.left + 5, rcItemRgn.top + 2 );
arrPointsClipArea[3] = CPoint( rcItemRgn.left + 4, rcItemRgn.top + 3 );
arrPointsClipArea[4] = CPoint( rcItemRgn.left + 3, rcItemRgn.top + 3 );
arrPointsClipArea[5] = CPoint( rcItemRgn.left + 2, rcItemRgn.top + 4 );
arrPointsClipArea[6] = CPoint( rcItemRgn.left + 1, rcItemRgn.top + 4 );
arrPointsClipArea[7] = CPoint( rcItemRgn.left, rcItemRgn.top + 5 );
if( bSelected || bFirstItem )
{
arrPointsClipArea[8] = CPoint( rcItemRgn.left - 14, rcItemRgn.bottom );
arrPointsClipArea[9] = CPoint( rcItemRgn.left - 16, rcItemRgn.bottom );
arrPointsClipArea[10]= CPoint( rcItemRgn.left - 16, rcItemRgn.bottom );
arrPointsClipArea[11]= CPoint( rcItemRgn.right, rcItemRgn.bottom );
if( bSelected )
{
arrPointsClipArea[10].y++;
arrPointsClipArea[11].y++;
}
}
else
{
arrPointsClipArea[8] = CPoint( rcItemRgn.left, rcItemRgn.bottom );
arrPointsClipArea[11]= CPoint( rcItemRgn.right - 2, rcItemRgn.bottom );
arrPointsClipArea[10] = arrPointsClipArea[9] = arrPointsClipArea[8];
}
arrPointsClipArea[12] = CPoint( rcItemRgn.right, rcItemRgn.bottom - 1 );
if( bFirstVisible /*nItemIndex == 0*/ )
for( int i = 2 ; i < sizeof(arrPointsClipArea)/sizeof(arrPointsClipArea[0]) - 3; i++ )
arrPointsClipArea[i].x += 16;
} // if( bTopLeft )
else
{
rcItemRgn.InflateRect( nItemIndex == 0 ? 0 : -1, 0, 0, 0 );
arrPointsBorders[0] = CPoint( rcItemRgn.right, rcItemRgn.top );
arrPointsBorders[1] = CPoint( rcItemRgn.right, rcItemRgn.bottom - 3 );
arrPointsBorders[2] = CPoint( rcItemRgn.right - 3, rcItemRgn.bottom );
arrPointsBorders[3] = CPoint( rcItemRgn.left + 5, rcItemRgn.bottom );
arrPointsBorders[4] = CPoint( rcItemRgn.left + 4, rcItemRgn.bottom - 1 );
arrPointsBorders[5] = CPoint( rcItemRgn.left + 3, rcItemRgn.bottom - 1 );
arrPointsBorders[6] = CPoint( rcItemRgn.left + 2, rcItemRgn.bottom - 2 );
arrPointsBorders[7] = CPoint( rcItemRgn.left + 1, rcItemRgn.bottom - 2 );
arrPointsBorders[8] = CPoint( rcItemRgn.left - 1, rcItemRgn.bottom - 4 );
if( bSelected || bFirstItem )
{
arrPointsBorders[9] = CPoint( rcItemRgn.left - 16, rcItemRgn.top + 1 );
arrPointsBorders[10] = CPoint( rcItemRgn.left - 17, rcItemRgn.top + 1 );
}
else
{
arrPointsBorders[9]= CPoint( rcItemRgn.left - 1, rcItemRgn.top + 1 );
arrPointsBorders[10]= arrPointsBorders[9];
}
if( bFirstVisible /*nItemIndex == 0*/ )
for( int i = 3 ; i < sizeof(arrPointsBorders)/sizeof(arrPointsBorders[0]); i++ )
arrPointsBorders[i].x += 16;
arrPointsInnerArea[0] = CPoint( rcItemRgn.right - 1, rcItemRgn.top );
arrPointsInnerArea[1] = CPoint( rcItemRgn.right - 1, rcItemRgn.bottom - 3 );
arrPointsInnerArea[2] = CPoint( rcItemRgn.right - 3, rcItemRgn.bottom - 1 );
arrPointsInnerArea[3] = CPoint( rcItemRgn.left + 5, rcItemRgn.bottom - 1 );
arrPointsInnerArea[4] = CPoint( rcItemRgn.left + 4, rcItemRgn.bottom - 2 );
arrPointsInnerArea[5] = CPoint( rcItemRgn.left + 3, rcItemRgn.bottom - 2 );
arrPointsInnerArea[6] = CPoint( rcItemRgn.left + 2, rcItemRgn.bottom - 3 );
arrPointsInnerArea[7] = CPoint( rcItemRgn.left + 1, rcItemRgn.bottom - 3 );
arrPointsInnerArea[8] = CPoint( rcItemRgn.left - 1, rcItemRgn.bottom - 5 );
if( bSelected || bFirstItem )
arrPointsInnerArea[9] = CPoint( rcItemRgn.left - 14, rcItemRgn.top + 1 );
else
arrPointsInnerArea[9] = CPoint( rcItemRgn.left - 1, rcItemRgn.top + 1 );
if( bFirstVisible /*nItemIndex == 0*/ )
for( int i = 3 ; i < sizeof(arrPointsInnerArea)/sizeof(arrPointsInnerArea[0]); i++ )
arrPointsInnerArea[i].x += 16;
arrPointsClipArea[0] = CPoint( rcItemRgn.right - 2, rcItemRgn.top );
arrPointsClipArea[1] = CPoint( rcItemRgn.right - 2, rcItemRgn.bottom - 2 );
arrPointsClipArea[2] = CPoint( rcItemRgn.left + 5, rcItemRgn.bottom - 2 );
arrPointsClipArea[3] = CPoint( rcItemRgn.left + 4, rcItemRgn.bottom - 3 );
arrPointsClipArea[4] = CPoint( rcItemRgn.left + 3, rcItemRgn.bottom - 3 );
arrPointsClipArea[5] = CPoint( rcItemRgn.left + 2, rcItemRgn.bottom - 4 );
arrPointsClipArea[6] = CPoint( rcItemRgn.left + 1, rcItemRgn.bottom - 4 );
arrPointsClipArea[7] = CPoint( rcItemRgn.left - 1, rcItemRgn.bottom - 6 );
if( bSelected || bFirstItem )
{
arrPointsClipArea[8] = CPoint( rcItemRgn.left - 15, rcItemRgn.top );
arrPointsClipArea[9] = CPoint( rcItemRgn.left - 16, rcItemRgn.top + 1 );
arrPointsClipArea[10]= CPoint( rcItemRgn.left - 16, rcItemRgn.top + 1 );
arrPointsClipArea[11]= CPoint( rcItemRgn.right, rcItemRgn.top + 1 );
if( bSelected )
{
arrPointsClipArea[10].y -= 1;
arrPointsClipArea[11].y -= 1;
}
}
else
{
arrPointsClipArea[8] = CPoint( rcItemRgn.left - 1, rcItemRgn.top + 1 );
arrPointsClipArea[11]= CPoint( rcItemRgn.right, rcItemRgn.top + 1 );
arrPointsClipArea[10] = arrPointsClipArea[9] = arrPointsClipArea[8];
}
arrPointsClipArea[12] = CPoint( rcItemRgn.right, rcItemRgn.top + 1 );
if( bFirstVisible /*nItemIndex == 0*/ )
for( int i = 2 ; i < sizeof(arrPointsClipArea)/sizeof(arrPointsClipArea[0]) - 3; i++ )
arrPointsClipArea[i].x += 16;
} // else if( bTopLeft )
} // if( bHorz )
else
{
if( bTopLeft )
{
rcItemRgn.InflateRect( 0, nItemIndex == 0 ? 0 : -1, 0, 1 );
arrPointsBorders[0] = CPoint( rcItemRgn.right, rcItemRgn.bottom );
arrPointsBorders[1] = CPoint( rcItemRgn.left + 3, rcItemRgn.bottom );
arrPointsBorders[2] = CPoint( rcItemRgn.left, rcItemRgn.bottom - 3 );
arrPointsBorders[3] = CPoint( rcItemRgn.left, rcItemRgn.top + 5 );
arrPointsBorders[4] = CPoint( rcItemRgn.left + 1, rcItemRgn.top + 4 );
arrPointsBorders[5] = CPoint( rcItemRgn.left + 1, rcItemRgn.top + 3 );
arrPointsBorders[6] = CPoint( rcItemRgn.left + 2, rcItemRgn.top + 2 );
arrPointsBorders[7] = CPoint( rcItemRgn.left + 2, rcItemRgn.top + 1 );
arrPointsBorders[8] = CPoint( rcItemRgn.left + 3, rcItemRgn.top );
if( bSelected || bFirstItem )
{
arrPointsBorders[9] = CPoint( rcItemRgn.right - 1, rcItemRgn.top - 16 );
arrPointsBorders[10] = CPoint( rcItemRgn.right - 1, rcItemRgn.top - 17 );
}
else
{
arrPointsBorders[9] = CPoint( rcItemRgn.left + 3, rcItemRgn.top );
arrPointsBorders[10]= CPoint( rcItemRgn.right, rcItemRgn.top );
}
if( bFirstVisible /*nItemIndex == 0*/ )
for( int i = 3 ; i < sizeof(arrPointsBorders)/sizeof(arrPointsBorders[0]); i++ )
arrPointsBorders[i].y += 16;
arrPointsInnerArea[0] = CPoint( rcItemRgn.right, rcItemRgn.bottom - 1 );
arrPointsInnerArea[1] = CPoint( rcItemRgn.left + 3, rcItemRgn.bottom - 1 );
arrPointsInnerArea[2] = CPoint( rcItemRgn.left + 1, rcItemRgn.bottom - 3 );
arrPointsInnerArea[3] = CPoint( rcItemRgn.left + 1, rcItemRgn.top + 5 );
arrPointsInnerArea[4] = CPoint( rcItemRgn.left + 2, rcItemRgn.top + 4 );
arrPointsInnerArea[5] = CPoint( rcItemRgn.left + 2, rcItemRgn.top + 3);
arrPointsInnerArea[6] = CPoint( rcItemRgn.left + 3, rcItemRgn.top + 2 );
arrPointsInnerArea[7] = CPoint( rcItemRgn.left + 3, rcItemRgn.top + 1 );
arrPointsInnerArea[8] = CPoint( rcItemRgn.left + 4, rcItemRgn.top );
if( bSelected || bFirstItem )
arrPointsInnerArea[9] = CPoint( rcItemRgn.right, rcItemRgn.top - 15 );
else
arrPointsInnerArea[9] = CPoint( rcItemRgn.right, rcItemRgn.top );
if( bFirstVisible /*nItemIndex == 0*/ )
for( int i = 3 ; i < sizeof(arrPointsInnerArea)/sizeof(arrPointsInnerArea[0]); i++ )
arrPointsInnerArea[i].y += 16;
arrPointsClipArea[0] = CPoint( rcItemRgn.right, rcItemRgn.bottom - 2 );
arrPointsClipArea[1] = CPoint( rcItemRgn.left + 3, rcItemRgn.bottom - 2 );
arrPointsClipArea[2] = CPoint( rcItemRgn.left + 2, rcItemRgn.bottom - 3 );
arrPointsClipArea[3] = CPoint( rcItemRgn.left + 2, rcItemRgn.top + 5 );
arrPointsClipArea[4] = CPoint( rcItemRgn.left + 3, rcItemRgn.top + 4 );
arrPointsClipArea[5] = CPoint( rcItemRgn.left + 3, rcItemRgn.top + 3);
arrPointsClipArea[6] = CPoint( rcItemRgn.left + 4, rcItemRgn.top + 2 );
arrPointsClipArea[7] = CPoint( rcItemRgn.left + 4, rcItemRgn.top + 1 );
if( bSelected || bFirstItem )
{
arrPointsClipArea[8] = CPoint( rcItemRgn.right, rcItemRgn.top - 15 );
arrPointsClipArea[9] = CPoint( rcItemRgn.right, rcItemRgn.top - 16 );
arrPointsClipArea[10]= CPoint( rcItemRgn.right, rcItemRgn.top - 16 );
arrPointsClipArea[11]= CPoint( rcItemRgn.right - 1, rcItemRgn.bottom );
if( bSelected )
{
arrPointsClipArea[10].x += 1;
arrPointsClipArea[11].x += 1;
}
arrPointsClipArea[12]= arrPointsClipArea[11];
}
else
{
arrPointsClipArea[8] = CPoint( rcItemRgn.left + 5, rcItemRgn.top );
arrPointsClipArea[9] = CPoint( rcItemRgn.right, rcItemRgn.top );
arrPointsClipArea[10]= CPoint( rcItemRgn.right, rcItemRgn.bottom );
arrPointsClipArea[12]=
arrPointsClipArea[11] =
arrPointsClipArea[10];
}
if( bFirstVisible /*nItemIndex == 0*/ )
for( int i = 3 ; i < sizeof(arrPointsClipArea)/sizeof(arrPointsClipArea[0]) - 3; i++ )
arrPointsClipArea[i].y += 16;
} // if( bTopLeft )
else
{
//rcItemRgn.InflateRect( 0, nItemIndex == 0 ? 0 : -1, 0, 0 );
arrPointsBorders[0] = CPoint( rcItemRgn.left, rcItemRgn.bottom );
arrPointsBorders[1] = CPoint( rcItemRgn.right - 3, rcItemRgn.bottom );
arrPointsBorders[2] = CPoint( rcItemRgn.right, rcItemRgn.bottom - 3 );
arrPointsBorders[3] = CPoint( rcItemRgn.right, rcItemRgn.top + 5 );
arrPointsBorders[4] = CPoint( rcItemRgn.right - 1, rcItemRgn.top + 4 );
arrPointsBorders[5] = CPoint( rcItemRgn.right - 1, rcItemRgn.top + 3 );
arrPointsBorders[6] = CPoint( rcItemRgn.right - 2, rcItemRgn.top + 2 );
arrPointsBorders[7] = CPoint( rcItemRgn.right - 2, rcItemRgn.top + 1 );
arrPointsBorders[8] = CPoint( rcItemRgn.right - 3, rcItemRgn.top );
if( bSelected || bFirstItem )
{
arrPointsBorders[9] = CPoint( rcItemRgn.left + 1, rcItemRgn.top - 16 );
arrPointsBorders[10]= CPoint( rcItemRgn.left + 1, rcItemRgn.top - 17 );
}
else
{
arrPointsBorders[9] = CPoint( rcItemRgn.right - 3, rcItemRgn.top );
arrPointsBorders[10]= CPoint( rcItemRgn.left, rcItemRgn.top );
}
if( bFirstVisible /*nItemIndex == 0*/ )
for( int i = 3 ; i < sizeof(arrPointsBorders)/sizeof(arrPointsBorders[0]); i++ )
arrPointsBorders[i].y += 16;
arrPointsInnerArea[0] = CPoint( rcItemRgn.left, rcItemRgn.bottom - 1 );
arrPointsInnerArea[1] = CPoint( rcItemRgn.right - 3, rcItemRgn.bottom - 1 );
arrPointsInnerArea[2] = CPoint( rcItemRgn.right - 1, rcItemRgn.bottom - 3 );
arrPointsInnerArea[3] = CPoint( rcItemRgn.right - 1, rcItemRgn.top + 5 );
arrPointsInnerArea[4] = CPoint( rcItemRgn.right - 2, rcItemRgn.top + 4 );
arrPointsInnerArea[5] = CPoint( rcItemRgn.right - 2, rcItemRgn.top + 3);
arrPointsInnerArea[6] = CPoint( rcItemRgn.right - 3, rcItemRgn.top + 2 );
arrPointsInnerArea[7] = CPoint( rcItemRgn.right - 3, rcItemRgn.top + 1 );
arrPointsInnerArea[8] = CPoint( rcItemRgn.right - 4, rcItemRgn.top );
if( bSelected || bFirstItem )
arrPointsInnerArea[9] = CPoint( rcItemRgn.left + 1, rcItemRgn.top - 15 );
else
arrPointsInnerArea[9] = CPoint( rcItemRgn.left + 1, rcItemRgn.top );
if( bFirstVisible /*nItemIndex == 0*/ )
for( int i = 3 ; i < sizeof(arrPointsInnerArea)/sizeof(arrPointsInnerArea[0]); i++ )
arrPointsInnerArea[i].y += 16;
arrPointsClipArea[0] = CPoint( rcItemRgn.left + 1, rcItemRgn.bottom - 2 );
arrPointsClipArea[1] = CPoint( rcItemRgn.right - 3, rcItemRgn.bottom - 2 );
arrPointsClipArea[2] = CPoint( rcItemRgn.right - 2, rcItemRgn.bottom - 3 );
arrPointsClipArea[3] = CPoint( rcItemRgn.right - 2, rcItemRgn.top + 5 );
arrPointsClipArea[4] = CPoint( rcItemRgn.right - 3, rcItemRgn.top + 4 );
arrPointsClipArea[5] = CPoint( rcItemRgn.right - 3, rcItemRgn.top + 3);
arrPointsClipArea[6] = CPoint( rcItemRgn.right - 4, rcItemRgn.top + 2 );
arrPointsClipArea[7] = CPoint( rcItemRgn.right - 4, rcItemRgn.top + 1 );
if( bSelected || bFirstItem )
{
arrPointsClipArea[8] = CPoint( rcItemRgn.left + 1, rcItemRgn.top - 14 );
arrPointsClipArea[9] = CPoint( rcItemRgn.left + 1, rcItemRgn.top - 15 );
arrPointsClipArea[10]= CPoint( rcItemRgn.left + 1, rcItemRgn.top - 15 );
arrPointsClipArea[11]= CPoint( rcItemRgn.left + 1, rcItemRgn.bottom );
if( bSelected )
{
arrPointsClipArea[10].x -= 1;
arrPointsClipArea[11].x -= 1;
}
arrPointsClipArea[12]= arrPointsClipArea[11];
}
else
{
arrPointsClipArea[8] = CPoint( rcItemRgn.right - 5, rcItemRgn.top );
arrPointsClipArea[9] = CPoint( rcItemRgn.left + 1, rcItemRgn.top );
arrPointsClipArea[10]= CPoint( rcItemRgn.left + 1, rcItemRgn.bottom );
arrPointsClipArea[12]=
arrPointsClipArea[11] =
arrPointsClipArea[10];
}
if( bFirstVisible /*nItemIndex == 0*/ )
for( int i = 3 ; i < sizeof(arrPointsClipArea)/sizeof(arrPointsClipArea[0]) - 3; i++ )
arrPointsClipArea[i].y += 16;
} // else if( bTopLeft )
} // else if( bHorz )
COLORREF clrBorderLight = (COLORREF)(-1L);
COLORREF clrBorderDark = (COLORREF)(-1L);
COLORREF clrBkLight = (COLORREF)(-1L);
COLORREF clrBkDark = (COLORREF)(-1L);
COLORREF clrText = (COLORREF)(-1L);
pWndTabs->OnTabWndQueryItemColors(
nItemIndex,
bSelected,
bHover,
bEnabled,
&clrBorderLight,
&clrBorderDark,
&clrBkLight,
&clrBkDark,
&clrText
);
if( clrForceTabText != COLORREF(-1L) )
clrText = clrForceTabText;
if( clrForceTabBk1 != COLORREF(-1L) )
clrBkLight = clrForceTabBk1;
if( clrForceTabBk2 != COLORREF(-1L) )
clrBkDark = clrForceTabBk2;
// draw item border
CBrush brushBorders( clrBorderDark );
CBrush brushBordersInnerArea( clrBorderLight );
CRgn rgnBorders, rgnBordersInnerArea, rgnClipArea;
VERIFY( rgnBorders.CreatePolygonRgn( arrPointsBorders, 11, ALTERNATE ) );
VERIFY( rgnBordersInnerArea.CreatePolygonRgn( arrPointsInnerArea, 10, ALTERNATE ) );
VERIFY( rgnClipArea.CreatePolygonRgn( arrPointsClipArea, 13, ALTERNATE ) );
dc.FrameRgn( &rgnBorders, &brushBorders, 1, 1 );
dc.FrameRgn( &rgnBordersInnerArea, &brushBordersInnerArea, 1, 1 );
// fill item background
CRect rcFill( rcItemRgn );
rcFill.InflateRect(
bHorz ? 20 : 0,
bHorz ? 0 : 20,
bHorz ? 20 : 0,
bHorz ? 0 : 20
);
if( bTopLeft )
rcFill.InflateRect(
0,
0,
bHorz ? 0 : 1,
bHorz ? 1 : 0
);
dc.SelectClipRgn( &rgnClipArea, RGN_AND );
if( ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) > 8 )
{
CExtPaintManager::stat_PaintGradientRect(
dc,
&rcFill,
bHorz
? ( bTopLeft ? clrBkDark : clrBkLight )
: ( bTopLeft ? clrBkLight : clrBkDark ),
bHorz
? ( bTopLeft ? clrBkLight : clrBkDark )
: ( bTopLeft ? clrBkDark : clrBkLight ),
bHorz
);
} // if( ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) > 8 )
else
{
dc.FillSolidRect(
&rcFill,
bSelected
? pWndTabs->PmBridge_GetPM()->GetColor( COLOR_WINDOW, pWndTabs )
: pWndTabs->PmBridge_GetPM()->GetColor( COLOR_3DFACE, pWndTabs )
);
} // else from if( ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) > 8 )
rcItem.DeflateRect(
bHorz
? __EXTTAB_ONENOTE_INDENT_LEFT
: ( bTopLeft ? __EXTTAB_ONENOTE_INDENT_TOP * 2 : __EXTTAB_ONENOTE_INDENT_BOTTOM ),
bHorz
? ( bTopLeft ? __EXTTAB_ONENOTE_INDENT_TOP : 0 )
: __EXTTAB_ONENOTE_INDENT_LEFT,
bHorz
? __EXTTAB_ONENOTE_INDENT_RIGHT
: 0,
bHorz
? 0
: __EXTTAB_ONENOTE_INDENT_RIGHT
);
// first item indent
if( bFirstVisible /*nItemIndex == 0*/ )
rcItem.DeflateRect(
bHorz ? 16 : 0,
(!bHorz) ? 16 : 0,
0,
0
);
bool bDrawIcon =
( pIcon != NULL
&& (!pIcon->IsEmpty())
&& (pWndTabs->GetTabWndStyle()&__ETWS_HIDE_ICONS) == 0
) ? true : false;
// if tab has no icons - increase left indent
if( (!bDrawIcon) && (pWndTabs->GetTabWndStyle()&__ETWS_CENTERED_TEXT) == 0 )
rcItem.DeflateRect(
bHorz ? 4 : 0,
0,
0,
0
);
CSize _sizeIcon( 0, 0 );
if( bDrawIcon )
{
_sizeIcon = pIcon->GetSize();
ASSERT( _sizeIcon.cx > 0 && _sizeIcon.cy > 0 );
}
CRect rcItemForIcon( rcItem );
if( bDrawIcon
&& _sizeIcon.cx > 0
&& _sizeIcon.cy > 0
)
{
rcItemForIcon.right = rcItemForIcon.left + _sizeIcon.cx;
rcItemForIcon.bottom = rcItemForIcon.top + _sizeIcon.cy;
rcItemForIcon.OffsetRect(
bHorz ? 0 : ((rcItem.Width() - _sizeIcon.cx) / 2),
bHorz ? ((rcItem.Height() - _sizeIcon.cy) / 2) : 0
);
if( rcItemForIcon.left < rcItem.left )
rcItemForIcon.left = rcItem.left;
if( rcItemForIcon.right > rcItem.right )
rcItemForIcon.right = rcItem.right;
if( rcItemForIcon.top < rcItem.top )
rcItemForIcon.top = rcItem.top;
if( rcItemForIcon.bottom > rcItem.bottom )
rcItemForIcon.bottom = rcItem.bottom;
}
CExtSafeString sItemText( (sText == NULL) ? _T("") : sText );
CRect rcText(
rcItem.left
+ ( bHorz
? (_sizeIcon.cx + ( ( _sizeIcon.cx > 0 ) ? 2*__EXTTAB_MARGIN_ICON2TEXT_X : 0 ) )
: 0
),
rcItem.top
+ ( bHorz
? 0
: ( _sizeIcon.cy + ( ( _sizeIcon.cy > 0 ) ? __EXTTAB_MARGIN_ICON2TEXT_Y : 0 ) )
),
rcItem.right,
rcItem.bottom
);
if( ! bHorz )
{
if( pIconTabItemCloseButton != NULL )
rcText.bottom = min( rcText.bottom, rcTabItemCloseButton.top );
int nWidth0 = rcText.Width();
int nWidth1 = rcItem.Width() + __EXTTAB_MARGIN_ICON2TEXT_X*2;
if( nWidth1 > nWidth0 )
{
if( bInvertedVerticalMode )
{
rcText.left = rcText.right - nWidth1;
} // if( bInvertedVerticalMode )
else
{
rcText.right = rcText.left + nWidth1;
} // else from if( bInvertedVerticalMode )
} // if( nWidth1 > nWidth0 )
} // if( !bHorz )
else
{
if( pIconTabItemCloseButton != NULL )
rcText.right = min( rcText.right, rcTabItemCloseButton.left );
}
bool bDrawText = ( ( ! sItemText.IsEmpty() ) && rcText.Width() > 6 && rcText.Height() > 6 ) ? true : false;
INT nIconAlignment = CExtPaintManager::__ALIGN_HORIZ_LEFT | CExtPaintManager::__ALIGN_VERT_TOP;
if( ( ! bDrawText) && ( ! ( bGroupedMode && ( ! bInGroupActive ) ) ) )
{
if( bCenteredText )
{
nIconAlignment = CExtPaintManager::__ALIGN_HORIZ_CENTER|CExtPaintManager::__ALIGN_VERT_CENTER;
rcItemForIcon = rcItem;
}
else
rcItemForIcon.OffsetRect(
bHorz ? ( rcItem.Width() - _sizeIcon.cx ) / 2 : 0,
bHorz ? 0 : ( rcItem.Height() - _sizeIcon.cy ) / 2
);
}
if( bDrawIcon )
{
if( ( bHorz && rcItemForIcon.Width() >= _sizeIcon.cx )
|| ( ( ! bHorz ) && rcItemForIcon.Height() >= _sizeIcon.cy )
)
{
rcItemForIcon.OffsetRect(
bHorz ? 4 : 0,
bHorz ? 0 : 4
);
pWndTabs->PmBridge_GetPM()->PaintIcon(
dc,
bHorz,
pIcon,
rcItemForIcon,
false,
bEnabled,
false,
nIconAlignment
);
}
}
if( bDrawText )
{ // if we have sense to paint text on tab item
ASSERT( pFont != NULL );
ASSERT( pFont->GetSafeHandle() != NULL );
bool bNoPrefix = ( ( pWndTabs->GetTabWndStyleEx() & __ETWS_EX_NO_PREFIX ) != 0 ) ? true : false;
COLORREF clrOldText = dc.SetTextColor( clrText );
INT nOldBkMode = dc.SetBkMode( TRANSPARENT );
CFont * pOldFont = dc.SelectObject( pFont );
if( ! bHorz )
{
if( bCenteredText )
rcText.OffsetRect(
0,
( rcText.Height() - sizeTextMeasured.cx ) / 2
);
int nTextLength = sItemText.GetLength();
int nAmpIndex = bNoPrefix ? (-1) : int( sItemText.Find( _T(’&’) ) );
CExtSafeString sBtn;
if( nAmpIndex < 0 || bNoPrefix )
sBtn = sItemText;
else
sBtn = sItemText.Left( nAmpIndex ) + sItemText.Right( nTextLength - ( nAmpIndex + 1 ) );
if( ! bNoPrefix )
{
static TCHAR stat_strDummyAmpSeq[] = _T("\001\001");
sBtn.Replace( _T("&&"), stat_strDummyAmpSeq );
sBtn.Remove( _T(’&’) );
sBtn.Replace( stat_strDummyAmpSeq, _T("&") );
}
LOGFONT lf;
::memset( &lf, 0, sizeof(LOGFONT) );
pFont->GetLogFont(&lf);
int _cyHorzFont = abs(lf.lfHeight);
int _cyTextMargin = (rcText.Width() - _cyHorzFont) / 2;
CPoint
ptLineFrom(0,0),
ptLineTo(0,0);
if( nAmpIndex >= 0 && ( ! bNoPrefix ) )
{
ptLineFrom =
CPoint(
__ExtMfc_CXTEXTMARGIN + _cyTextMargin,
__ExtMfc_CYTEXTMARGIN + CExtPaintManager::stat_CalcTextWidth( dc, *pFont, sBtn.Left( nAmpIndex ) )
);
ptLineTo =
CPoint(
__ExtMfc_CXTEXTMARGIN + _cyTextMargin,
__ExtMfc_CYTEXTMARGIN + CExtPaintManager::stat_CalcTextWidth( dc, *pFont, sBtn.Left( nAmpIndex + 1 ) )
);
int nXOffsPlus = rcText.Width() - CExtPaintManager::stat_CalcTextDimension( dc, *pFont, sBtn ).Height();
nXOffsPlus /= 2;
nXOffsPlus -= 4;
ptLineFrom.x += nXOffsPlus;
ptLineTo.x += nXOffsPlus;
} // if( nAmpIndex >= 0 )
CRect rcString =
CRect(
CPoint(
rcText.right - _cyTextMargin + __ExtMfc_CXTEXTMARGIN,
rcText.top + __ExtMfc_CYTEXTMARGIN
),
rcText.Size() //m_sizeHorz
);
rcString.DeflateRect( 2, 2 );
if( bInvertedVerticalMode )
{
rcString.OffsetRect( 0, -2 );
CSize ptFix( -rcString.Width() + 1, 0 );
ptLineFrom.x += sizeTextMeasured.cy - 2;
ptLineFrom.y = - ptLineFrom.y + sizeTextMeasured.cx - 4;
ptLineTo.x += sizeTextMeasured.cy - 2;
ptLineTo.y = - ptLineTo.y + sizeTextMeasured.cx - 4;
ptLineFrom += rcString.TopLeft() + ptFix;
ptLineTo += rcString.TopLeft() + ptFix;
rcString.OffsetRect( - sizeTextMeasured.cy + 3, sizeTextMeasured.cx - 3 );
}
else
{
rcString.OffsetRect( -2, 0 );
CSize ptFix( -rcString.Width() + 1, 0 );
ptLineFrom += rcString.TopLeft() + ptFix;
ptLineTo += rcString.TopLeft() + ptFix;
}
dc.DrawText(
sBtn,
sBtn.GetLength(),
rcString,
DT_SINGLELINE | DT_NOCLIP | ( bNoPrefix ? (DT_NOPREFIX) : 0 )
);
if( nAmpIndex >= 0 )
{
CPen pen(
PS_SOLID,
0,
dc.GetTextColor()
);
CPen * pOldPen = dc.SelectObject( &pen );
dc.MoveTo( ptLineFrom );
dc.LineTo( ptLineTo );
dc.SelectObject( pOldPen );
} // if( nAmpIndex >= 0 )
} // if( !bHorz )
else
{
UINT nFormat =
DT_SINGLELINE|DT_VCENTER|DT_END_ELLIPSIS;
if( bCenteredText )
nFormat |= DT_CENTER;
else
nFormat |= DT_LEFT;
if( bNoPrefix )
nFormat |= DT_NOPREFIX;
dc.DrawText(
sItemText,
sItemText.GetLength(),
rcText,
nFormat
);
}
dc.SelectObject( pOldFont );
dc.SetBkMode( nOldBkMode );
dc.SetTextColor( clrOldText );
} // if we have sense to paint text on tab item
if( pIconTabItemCloseButton != NULL )
{
ASSERT( ! pIconTabItemCloseButton->IsEmpty() );
if( dc.RectVisible( &rcTabItemCloseButton ) )
{
CRect _rcTabItemCloseButton = rcTabItemCloseButton;
if( bHorz )
{
if( bTopLeft )
_rcTabItemCloseButton.OffsetRect( 0, 1 );
}
else
{
if( bTopLeft )
_rcTabItemCloseButton.OffsetRect( 1, 0 );
}
pIconTabItemCloseButton->Paint(
g_PaintManager.GetPM(),
dc.m_hDC,
_rcTabItemCloseButton,
ePaintStateITICB
);
}
} // if( pIconTabItemCloseButton != NULL )
dc.SelectClipRgn( NULL );
}
|
|
Robert Hofstetter
|
Jun 2, 2010 - 12:57 AM
|
Could you tell me how CExtReportGridWnd sorts the rows if the column it sorts by has the same string values? It seems to me that the rows are sorted in a random order. I would like to see it display the rows in a constant order if i refresh it with the same data. Is it a bug ? or I have to setup the secondary sort order? I did not set sort order programmatically. Just used the defaults in CExtReportGridWnd. Users click whatever column header they want to sort. Thanks for any suggestion!
|
|
Robert Hofstetter
|
Jun 3, 2010 - 1:42 AM
|
Thanks for reply. I don’t use any styles or special controls in the grid. All the grid cells are strings in the same font. My question is If every grid cells in the sort column are identical (the other columns have different strings), does CExtReportGridWnd display the rows in a certain order, or just random order, or the order that row are created? Thanks?
|
|
Technical Support
|
Jun 3, 2010 - 7:55 AM
|
If all grid cells in a sorted column are equal to each other, the grid control does not swap any columns during sorting. Just sort arrow in the header column changes its orientation.
|
|
Technical Support
|
Jun 2, 2010 - 7:47 AM
|
The CExtReportGridWnd control uses a quick sort algorithm. The grid cells are compared using the CExtGridCell::CompareEx() method which is implemented in all the grid cells. Each grid cell class detects whether it’s compared with the same type. If yes, then the grid cell performs comparison of its data with other cell of the same type. If not, then the generic OLE VARIANT -based comparison is performed because each grid cell can return its data in the OLE VARIANT data structure. If the grid cells are equal, then the cell style comparison is performed by the CExtGridCell::CompareStyleOnly() method. If the styles are equal, then both grid cells are completely equal. But not all the styles are used in this comparison - just some of them. The following constants define the basic and extended style masks for comparison:
#define __EGCS_COMPARE_MASK (__EGCS_CHK_MASK|__EGCS_CHECKED)
#define __EGCS_EX_COMPARE_MASK (__EGCS_EX_EMPTY)
This means the empty cell state and checked/radio state are used in the cell comparisons. Other cell styles are not used. The equal cells are never swapped by the quick sort algorithm. We checked this in the ReportGrid sample application.
|
|
Gevork Odabashyan
|
Jun 2, 2010 - 12:28 AM
|
Hello,
I am using your product already for several years and
all this years I am suprising for your bug fixing policy.
For instance, currently you fixed some very important bugs, but they not
available for the most users becouse you send them only for exclusive users who requested this bugs fixing.
For this reason, I have a proposal to introduce INTERMEDIATE BUILDS for the current release which wil have the official status.
These builds will be contain bugs fixing for the last release.
In this way bugs fixing will be available to everybody, but not just exclusive users.
Futher more this increased the chance that the current bugs fixing will be included into the next release.
It will be interesting to hear your opinion on this issue.
|
|
Technical Support
|
Jun 2, 2010 - 11:34 AM
|
To release Prof-UIS is to:
1) Build everything with every supported VC++ version. This is 14-15 hours. 2) To run everything, click on everything, check everything. It’s not possible to say how much time exactly is this. 3) Build Install shield project, test it. This is 2 hours. 4) We do not include time for preliminary testing of everything new, modified and affected by any code changes before previous 3 tasks.
We think in total this will be at least 3 work days. But we are mostly ready to release 2.90 with serious improvements this month (in 1-2 weeks). If we avoid hot-fix release before it, then the real 2.90 will be released at least 3 days earlier.
|
|
Offer Har
|
Jun 2, 2010 - 6:12 AM
|
I agree - we also would like to have access to the latest build even if it’s not official.
|
|
Offer Har
|
Jun 1, 2010 - 7:59 AM
|
Dear Support, We need to implement a gantt chart - do you have any ready-to use controls or any lead where we can start developing such chart? Thanks, Ron.
|
|
Technical Support
|
Jun 2, 2010 - 9:56 AM
|
|
|
Rado Manzela
|
Jun 1, 2010 - 6:30 AM
|
Can you provide some sample how to implement dragging text cell from one grid and drop it into another grid please? I cannot find anything like this in samples, I’ve tried to override OnGbwDataDndIsAllowed() and OnGbwDataDndDo() as suggested in FAQ, but I don’t have a clue how the implementation of OnGbwDataDndDo() should look like. I’ve hoped such trivial d&d will be done in default implementation, but it does nothing. Maybe because there seems to be some bug, because my OnGbwDataDndDo() is always called with htInfo.m_nColNo = htInfo.m_nRowNo = -1 no matters which cell is selected/focused/dragged. Thank you,
|
|
Technical Support
|
Jun 2, 2010 - 10:34 AM
|
We recommend that you use the standard OLE drag-n-drop. It’s easy to use it. Prof-UIS is friendly with OLE drag-n-drop. When some OLE data object is drag-n-dropped over Prof-UIS tab items, then appropriate tab item becomes selected. This is related to MDI tabs, tabbed resizable bar groups and tab page container. This means you will be able to drop data into windows hidden in some non-selected tab page in some tabbed window container. First of all, your app should initialize OLE. You will need to invoke AfxOleInit() or OleInitialize() . The CoInitialize() is not enough to start using OLE drag-n-drop APIs. The UI element or window which starts drag-n-dropping something is called drag-n-drop source (IOleDropSource , COleDropSource ). The UI element or window which can accept drag-n-drop events (moving mouse over/in/out, dropping) is called drag-n-drop target (IOleDropTarget , COleDropTarget ). You need two grid controls: one should implement drag-n-drop source, second is drag-n-drop target. You can implement both source and target in one grid control and you will be able to drag-n-drop from the grid control into the same grid control. Please note, the OLE drag-n-drop works between different running processes and between different threads of one app. If you need to limit its usage in scope of one UI thread of one process, then you should use your own registered clipboard format and generate its name using thread and process identifiers. The CExtGridWnd grid control (and other derived from it grid controls) supports the OLE drag-n-drop (CExtGridWnd::OnGridDropSource*** , CExtGridWnd::OnGridDropTarget*** ). The __EGWS_ADV_ENABLE_DATA_DND_DRAG|__EGWS_ADV_ENABLE_DATA_DND_DROP advanced flags applied with the CExtGridWnd::AdvModifyStyle() method will turn on the OLE drag-n-dropping feature in the CExtGridWnd grid control. The CExtGridWnd::m_strGridClipboardFormatName property allows you specify custom unique name for clipboard format. The grid control drag-n-drops abstract grid cell regions of any complexity. The cell regions are described using the CExtGR2D class. The grid control does not drag-n-drop text strings. It drag-n-drops regions of cell objects. When one or several grid cells are dropped, then the grid control creates instances of cells of the same type as cells which you stared drag-n-drop. The data of these cells are de-serialized from the OLE drag-n-drop data object. You can see the OLE drag-n-drop for abstract grid cell regions in the FormulaGrid sample application. The same abstract regions are supported for clipboard operations (CExtGridBaseWnd::m_dwSupportedAccelCommands , __EGSA_COPY|__EGSA_CUT|__EGSA_PASTE ). But if you would like to implement the OLE drag-n-drop from scratch, then please take a look at the source code of the FormEditor sample application. The toolbox objects can be drag-n-dropped from the toolbox window into the form editor window and into different object groups inside the same toolbox window. The toolbox customization window also implements the OLE drag-n-drop source.
|
|
Rado Manzela
|
Jun 3, 2010 - 8:15 AM
|
Thank you for explaining. I’ve used your original D&D, but now I need to enable only DROPEFFECT_COPY and make it default. Setting cell to be read-only does not help, dragging will move it’s content. Maybe you could check for read-only flag of source cells while d&d. I’ve solved this by overriding OnGbwDataDndDo() where I’ve copied complete code from your implementation and just changed one line to DROPEFFECT deAllow = DROPEFFECT_COPY; But I’m nervous when copying code from parent class, do you think it is safe? I’m afraid your code will be changed in future releases and I’ll get some nasty bugs in my program after upgrade. Maybe you could query for allowed drop effect somewhere in next version.
|
|
Technical Support
|
Jun 3, 2010 - 10:21 AM
|
The most correct way is to override the CExtGridWnd::OnGridDropTargetDragOver() virtual method and let the parent class method compute the DROPEFFECT value. If the computed value is DROPEFFECT_MOVE , then do not return it and just return DROPEFFECT_COPY instead. The parent class method assumes the DROPEFFECT_MOVE is the default effect. But if the Ctrl key is pressed, then it assumes the DROPEFFECT_COPY effect. This is the classic drag-n-dropping behavior.
|
|
Rado Manzela
|
Jun 4, 2010 - 1:38 AM
|
|
|
Rado Manzela
|
Jun 1, 2010 - 5:29 AM
|
Is it possible to let the user to change width of outer left column in the grid? I’m using __EGBS_RESIZING_CELLS_OUTER_H|__EGBS_DYNAMIC_RESIZING_H but it works only above inner columns. Thank you.
|
|
Technical Support
|
Jun 2, 2010 - 10:34 AM
|
The __EGBS_RESIZING_CELLS_OUTER_H style allows you to change the grid row’s height by drag-n-dropping the horizontal margins of the outer header cells in the left/right header columns. The horizontal resizing of the outer header columns is not supported. Please convert your outer header columns into the frozen data columns and you will be able to resize them
|
|
Ulrich Heinicke
|
May 31, 2010 - 11:04 PM
|
Hi, i’m using the version 2.89 under XP SP3. My program starts with the theme CExtPaintManagerXP in maximized mode. It’s work ok.
After switching to an Office 2007 or Office 2010 theme the window is too large.
In every corner there are pixels missing.
|
|
Technical Support
|
Jun 2, 2010 - 10:35 AM
|
Thank you for reporting this issue. To fix it, please update the source code for the following method:
void CExtPmBridgeNC::_AdjustThemeSettings()
{
if( m_pNcFrameImpl == NULL
|| m_pNcFrameImpl->m_bNcFrameImpl_InAdjustAdjustThemeSettings
)
return;
m_pNcFrameImpl->m_bNcFrameImpl_CreatePassed = true;
HWND hWndOwn = PmBridge_GetSafeHwnd();
if( hWndOwn == NULL )
return;
ASSERT( ::IsWindow( hWndOwn ) );
m_pNcFrameImpl->m_bNcFrameImpl_InAdjustAdjustThemeSettings = true;
WINDOWPLACEMENT _wp;
::memset( &_wp, 0, sizeof(WINDOWPLACEMENT) );
_wp.length = sizeof(WINDOWPLACEMENT);
CExtNcFrameImpl::stat_GetWindowPlacement( hWndOwn, _wp );
if( ( ::__EXT_MFC_GetWindowLong( hWndOwn, GWL_STYLE ) & WS_VISIBLE ) == 0 )
_wp.showCmd = SW_HIDE;
CWnd * pWndFrameImpl = (CWnd *)m_pNcFrameImpl->NcFrameImpl_GetFrameWindow();
pWndFrameImpl->ModifyStyle( 0, WS_CAPTION|WS_BORDER, 0 );
m_pNcFrameImpl->m_bNcFrameImpl_IsActive = false;
if( pWndFrameImpl != NULL && pWndFrameImpl->IsWindowEnabled() )
{
HWND hWndFocus = ::GetFocus();
if( hWndFocus != NULL
&& ( pWndFrameImpl->m_hWnd == hWndFocus
|| ::IsChild( pWndFrameImpl->m_hWnd, hWndFocus )
)
)
m_pNcFrameImpl->m_bNcFrameImpl_IsActive = true;
}
DWORD dwInitialStyle = m_pNcFrameImpl->NcFrameImpl_GetInitialStyle();
DWORD dwCurrentStyle = dwInitialStyle;
HWND hWndSurface = NULL;
if( (dwCurrentStyle&(WS_CHILD|WS_VISIBLE)) == WS_VISIBLE
&& (! m_pNcFrameImpl->m_bNcFrameImpl_PivotPmSyncMode )
)
{
CRect rcSurface;
::GetWindowRect( hWndOwn, &rcSurface );
hWndSurface =
::CreateWindowEx(
0, _T("Static"), _T(""), WS_POPUP,
rcSurface.left,
rcSurface.top,
rcSurface.Width() + ( ( _wp.showCmd == SW_SHOWNORMAL && g_PaintManager.m_bIsWinXPorLater ) ? 1 : 0 ),
rcSurface.Height(),
hWndOwn, (HMENU)NULL, ::AfxGetInstanceHandle(), NULL
);
if( hWndSurface != NULL )
{
::EnableWindow( hWndSurface, FALSE );
::ShowWindow( hWndSurface, SW_SHOWNOACTIVATE );
}
}
CExtNcFrameImpl::NcLock _NcLock( * m_pNcFrameImpl );
::SetWindowRgn( hWndOwn, NULL, TRUE );
if( ! ::IsWindow( hWndOwn ) )
return;
_NcLock.UnlockNow();
if( m_pNcFrameImpl->NcFrameImpl_IsDwmCaptionReplacement() )
m_pNcFrameImpl->NcFrameImpl_AdjustVistaDwmCompatibilityIssues();
else
m_pNcFrameImpl->NcFrameImpl_SetupRgn();
if( pWndFrameImpl != NULL
&& pWndFrameImpl->IsKindOf( RUNTIME_CLASS(CMDIChildWnd) )
&& g_PaintManager.m_UxTheme.IsAppThemed()
)
{
CRect rc;
pWndFrameImpl->GetWindowRect( &rc );
pWndFrameImpl->GetParent()->ScreenToClient( &rc );
rc.left ++;
pWndFrameImpl->MoveWindow( &rc, FALSE );
rc.left --;
pWndFrameImpl->MoveWindow( &rc, FALSE );
}
m_pNcFrameImpl->NcFrameImpl_RecalcNcFrame();
CWnd * pWndPermanent = CWnd::FromHandlePermanent( hWndOwn );
if( pWndPermanent != NULL )
{
CFrameWnd * pFrameWnd = DYNAMIC_DOWNCAST( CFrameWnd, pWndPermanent );
if( pFrameWnd != NULL )
pFrameWnd->RecalcLayout();
}
if( m_pNcFrameImpl->NcFrameImpl_IsSupported()
&& ( ! m_pNcFrameImpl->NcFrameImpl_IsDwmCaptionReplacement() )
)
{
m_pNcFrameImpl->NcFrameImpl_SetupRgn( NULL );
::RedrawWindow( hWndOwn, NULL, NULL, RDW_INVALIDATE|RDW_ERASE|RDW_FRAME|RDW_ALLCHILDREN );
}
else
{
m_pNcFrameImpl->NcFrameImpl_RecalcNcFrame();
if( (dwCurrentStyle&(WS_CHILD|WS_VISIBLE)) == WS_VISIBLE )
{
switch( _wp.showCmd )
{
case SW_SHOWNORMAL:
if( g_PaintManager.m_bIsWinXPorLater )
{
CRect rc = _wp.rcNormalPosition;
rc.right++;
MoveWindow( hWndOwn, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, FALSE );
rc.right--;
MoveWindow( hWndOwn, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, FALSE );
}
break;
}
}
}
if( m_pNcFrameImpl->NcFrameImpl_IsDwmCaptionReplacement() )
m_pNcFrameImpl->NcFrameImpl_RecalcNcFrame();
else if( m_pNcFrameImpl->NcFrameImpl_IsSupported() )
CExtNcFrameImpl::stat_SetWindowPlacement( hWndOwn, _wp );
bool bContinueRecalc = true;
while( bContinueRecalc )
{
bContinueRecalc = false;
MSG _msg;
while( ::PeekMessage( &_msg, NULL, WM_WINDOWPOSCHANGING, WM_WINDOWPOSCHANGED, PM_NOREMOVE ) )
{
if( ! ::GetMessage( &_msg, NULL, WM_WINDOWPOSCHANGING, WM_WINDOWPOSCHANGED ) )
break;
::DispatchMessage( &_msg );
bContinueRecalc = true;
}
while( ::PeekMessage( &_msg, NULL, WM_NCCALCSIZE, WM_NCCALCSIZE, PM_NOREMOVE ) )
{
if( ! ::GetMessage( &_msg, NULL, WM_NCCALCSIZE, WM_NCCALCSIZE ) )
break;
::DispatchMessage( &_msg );
bContinueRecalc = true;
}
while( ::PeekMessage( &_msg, NULL, WM_WINDOWPOSCHANGING, WM_WINDOWPOSCHANGED, PM_NOREMOVE ) )
{
if( ! ::GetMessage( &_msg, NULL, WM_WINDOWPOSCHANGING, WM_WINDOWPOSCHANGED ) )
break;
::DispatchMessage( &_msg );
bContinueRecalc = true;
}
while( ::PeekMessage( &_msg, NULL, WM_SIZE, WM_SIZE, PM_NOREMOVE ) )
{
if( ! ::GetMessage( &_msg, NULL, WM_SIZE, WM_SIZE ) )
break;
::DispatchMessage( &_msg );
bContinueRecalc = true;
}
}
if( hWndSurface != NULL )
{
::DestroyWindow( hWndSurface );
CExtPaintManager::stat_PassPaintMessages();
}
if( ! m_pNcFrameImpl->NcFrameImpl_IsDwmBased() )
{
HWND hWndCheckZoomState = m_pNcFrameImpl->NcFrameImpl_OnQueryHWND();
if( hWndCheckZoomState != NULL
&& ::IsWindow( hWndCheckZoomState )
&& ::IsZoomed( hWndCheckZoomState )
)
{
CExtPaintManager::monitor_parms_t _mp;
CExtPaintManager::stat_GetMonitorParms( _mp, hWndCheckZoomState );
::SendMessage( hWndCheckZoomState, WM_SETREDRAW, 0L, 0L );
MINMAXINFO _mmi;
::memset( &_mmi, 0, sizeof(MINMAXINFO) );
_mmi.ptMaxPosition.x = _mp.m_rcWorkArea.left;
_mmi.ptMaxPosition.y = _mp.m_rcWorkArea.top;
_mmi.ptMaxTrackSize.x = _mp.m_rcWorkArea.Width();
_mmi.ptMaxTrackSize.y = _mp.m_rcWorkArea.Height();
_mmi.ptMinTrackSize.x = ::GetSystemMetrics( SM_CXMINTRACK );
_mmi.ptMinTrackSize.y = ::GetSystemMetrics( SM_CYMINTRACK );
_mmi.ptMaxSize.x = _mmi.ptMaxTrackSize.x;
_mmi.ptMaxSize.y = _mmi.ptMaxTrackSize.y;
::SendMessage( hWndCheckZoomState, WM_GETMINMAXINFO, 0, LPARAM(&_mmi) );
CSize maxSize(
max( _mmi.ptMaxTrackSize.x, _mp.m_rcWorkArea.Width() ),
max( _mmi.ptMaxTrackSize.y, _mp.m_rcWorkArea.Height() )
);
CRect rcMax( _mmi.ptMaxPosition, maxSize );
WINDOWPLACEMENT _wp, _wp2;
::memset( &_wp, 0, sizeof(WINDOWPLACEMENT) );
_wp.length = sizeof(WINDOWPLACEMENT);
::GetWindowPlacement( hWndCheckZoomState, &_wp );
::memcpy( &_wp2, &_wp, sizeof(WINDOWPLACEMENT) );
CRect rcMaxInflated( rcMax );
if( m_pNcFrameImpl->NcFrameImpl_IsSupported() )
{
CRect rcInflate, rcTmp;
PmBridge_GetPM()->NcFrame_GetMetrics( rcInflate, rcTmp, pWndFrameImpl );
rcMaxInflated.InflateRect( rcInflate );
}
else
rcMaxInflated.InflateRect( ::GetSystemMetrics(SM_CXFRAME), ::GetSystemMetrics(SM_CYFRAME) );
_wp2.ptMaxPosition = rcMaxInflated.TopLeft();
::CopyRect( &_wp2.rcNormalPosition, &rcMaxInflated );
_wp2.showCmd = SW_SHOWMAXIMIZED;
::SetWindowPlacement( hWndCheckZoomState, &_wp2 );
_wp.showCmd = SW_SHOWMAXIMIZED;
::SendMessage( hWndCheckZoomState, WM_SETREDRAW, 1L, 0L );
::SetWindowPlacement( hWndCheckZoomState, &_wp );
}
}
m_pNcFrameImpl->m_bNcFrameImpl_InAdjustAdjustThemeSettings = false;
}
|
|
Rado Manzela
|
May 31, 2010 - 6:39 AM
|
I’m creating CExtDynamicBarSite::BarAlloc with static desiredCmdId in my sdi frame, which is created on user’s request. It works when frame is created for the first time, but when user closes frame and creates it again, BarAlloc fails, because cmdId is already registered in cmd manager. Isn’t destructor of CExtDynamicControlBar supposed to do g_CmdManager->CmdRemove() for it’s command id?
|
|
Technical Support
|
May 31, 2010 - 12:59 PM
|
The CExtDynamicBarSize class restores all the bars you created. So, you don’t have to create it and dock it initially when your app starts second time.
|
|