Subject |
Author |
Date |
|
Sergio Buonanno
|
Aug 6, 2008 - 2:38 AM
|
I have an application with MS Outlook look and feel. The page navigation control on the left is divided in two panes: a standard pane and a Favorites pane. The Favorites pane is located at the top of the navigation control as in Outlook and its height is calculated in the following way:
The height must be enough to show all the tree items inside the control but it cannot be higher than half of the entire navigation control client area that is occupied by the Favorites and Main tree controls (each inside a pane), because the Standard Tree (that looks like the Main Folders in Outlook) has higher priority and it must occupied an area that at least is half the height of the page navigation control client area, and it can never be shorter than the Favorites tree control. The behavior of my application is slightly different from that of Outlook, where the Favorites pane has higher priority and its height could be higher than that of the Main Folders’. In my case is exactly the opposite, even if the UI of the page navigation control is exactly like Outlook’s.
I succeed to manage this situation when the page navigation control is docked to the application main window using the methods: CExtPageNavigatorWnd::ITEM_PANE_INFO->HeightSet(hFavPane);
CExtPageNavigatorWnd::ITEM_PANE_INFO->HeightSet(hMainPane); (In other words: hFavPane cannot be greater than hMainPane and in any case it must be <= of half the page navigation control client area’s height) But that doesn’t work when the navigation pane is floating. May you please suggest me a better way to calculate and set panes height at run-time so that I can have full control in settings panes’ height especially when the page navigation control is floating and not docked ?
|
|
Sergio Buonanno
|
Aug 13, 2008 - 6:53 AM
|
I’m sorry, I had a problem with the Paste command....my code is: CExtPageNavigatorWnd::PAGE_ITEM_INFO *pPage = m_pParentNav->ItemGetInfo(m_iPage /*idxPage*/);
CExtPageNavigatorWnd::ITEM_PANE_INFO *pPane1 = pPage->PaneGetInfo(INDEX_PANE_FAVORITES);
CExtPageNavigatorWnd::ITEM_PANE_INFO *pPane2 = pPage->PaneGetInfo(INDEX_PANE_NAVIGATION); CRect rcPage;
m_pParentNav->GetClientRect(rcPage);
int iMinH = (rcPage.Height() / 2) - 10;
long lHalfH = iMinH / 2; The value of lHalfH is the problem, because m_pParentNav->GetClientRect(rcPage) fails to return the correct value when the pane is floating. I need to calculate the value of half the height of the Page Navigation control’s client area and that doesn’t work correctly when the Page Navigation control is floating.
|
|
Technical Support
|
Aug 14, 2008 - 2:21 PM
|
GetClientRect may return a zero rectangle if the control bar where you created your page navigator is not yet shown on the screen. Try to move your code after the control bar become visible. For example after CExtControlBar::ProfileBarStateLoad method invocation if you use control bar persistence.
|
|
Technical Support
|
Aug 9, 2008 - 12:12 PM
|
The current page navigator implementation allows you to set one pane with its height automatically calculated . If you specify the item height equal to -1, then this item will always have the height that is equal to the free space left after resizing other panes. Notice that only one pane can have the height equal to -1. In your case, you can set -1 for the first favorites pane and some particular height for the second main pane. If this solution is not that you are looking for, please let us know.
|
|
Sergio Buonanno
|
Aug 11, 2008 - 1:02 AM
|
That is what I do, but unfortunately it doesn’t work when the Page Navigator control is floating. In that case it looks like the method HeightSet changes behavior and it doesn’t work correctly. In my function a make the following calls:
pPane1->HeightSet(lNewFavoritesH);
pPane2->HeightSet(-1);
lNewFavoritesH value depends on the number of tree items in the Favorites pane. Everything is ok with a docked Page Navigator control; it stops working when the Page Navigator is floating, I mean, the Favorites pane (Pane 1) is reduced to almost zero height.
Take into account that the Page Navigator control’s panes height is set during application start-up in the OnCreate event handler of the main window.
|
|
Filippo Murroni
|
Aug 5, 2008 - 11:31 AM
|
Hi, I have a serious problem with tooltips for common controls, created dynamic at run time, insiede an object derived from the CExtToolControlBar class. Using the property "SetTooltipText", I can see the correct tooltips, for e ctrl like CExtButton , inside objects based on statusbar ed ccontrolbar, but not on toolbar !!! In a toolbar I can see the tooltip only if the mouse pointer is stopped in most exetern site of the box !!! If the pointer is inside the box a can’t see any tooltips !!! Can you help me? Please... Thanks a lot for the help!
|
|
Filippo Murroni
|
Aug 11, 2008 - 2:25 AM
|
Thanks a lot for your help... I know that in toolbar I can use the CExtBarButton, infact I use also these objects in my App. But we need to insert CExtButton in toolbar, dialog and status to be compatible with components of the old versions!!! Can we help me? please...
|
|
Technical Support
|
Aug 18, 2008 - 4:36 AM
|
Thank you for your report. This is fixed. Please contact us via email so we can provide you with the update.
|
|
Filippo Murroni
|
Sep 4, 2008 - 1:27 AM
|
I have sent 2 emails to the support (support@prof-uis.com), but I don’t have received any reply with the update.... Sorry, but I need it...
|
|
Technical Support
|
Sep 4, 2008 - 8:18 AM
|
We are sorry but we did not receive your emails. Please send it again. Our alternative address is profuis at gmail.com.
|
|
Technical Support
|
Aug 9, 2008 - 12:14 PM
|
What is the reason of using CExtButton inside the toolbar buttons? The ordinary toolbar CExtBarButton button should fit all your needs. Moreover it is better for performance. When you are using CExtBarButton buttons, the CExtToolControlBar control does not use any windows/controls inside. It paints the buttons directly on its surface. Each button is an instance of the CExtBarButton class. The buttons generally know only their command identifiers. The images, tooltips and other text are stored as command descriptions in the command manager and as a result, the images you can see on command buttons in toolbars are automatically displayed in the same command items in menus because Prof-UIS menus are also based on the command manager. You can get a CExtCmdItem command description object by its command identifier using CExtCmdManager::CmdGetPtr() .
Here is how you can set the tooltip text for the toolbar button with nButtonIndex index. CExtToolControlBar & wndToolBar = . . .
INT nButtonIndex = . . .
CExtBarButton * pTBB = wndToolBar.GetButton( nButtonIndex );
if( pTBB == NULL )
return . . . // if nButtonIndex specifies invalid index
ASSERT_VALID( pTBB );
if( pTBB->IsSeparator() )
return . . . // if toolbar button at nButtonIndex position is separator
UINT nCommandID = pTBB->GetCmdID( false );
if( ! nCommandID::IsCommand( nCommandID ) )
return . . . // if some specific toolbar button
CExtCmdItem * pCmdItem = g_CmdManager->CmdGetPtr( g_CmdManager->ProfileNameFromWnd( wndToolBar.GetSafeHwnd() ), nCommandID );
if( pCmdItem == NULL )
return . . . // if command is not registered in the command manager (normally this should not occur)
pCmdItem->m_sTipTool = _T("This is the tooltip text");
|
|
Chris Anderson
|
Aug 4, 2008 - 6:36 PM
|
this seems to be a bug inside CExtScrollBar. We have a class derived from CExtScrollBar, inside the WindowProc, we found it received additional WM_HSCROLL message with wParam set to SB_THUMBPOSITION and SB_THUMBTRACK, whicn is incorrect as SB_THUMB... should be sent only when the user clicks the thumb.
The additional message is geneated inside
void CUfcScrollBar::_SetScrollPos( ...) function
if( bSendScrollingNotification && _psbd.m_bEnabled )
{
HWND hWndParent = ::GetParent( m_hWnd ); if( hWndParent != NULL ) { ::SendMessage( hWndParent, _psbd.m_bHorzBar ? WM_HSCROLL : WM_VSCROLL, MAKEWPARAM( ( bTrackPos ? SB_THUMBTRACK : SB_THUMBPOSITION ), nPos ), LPARAM(m_hWnd) ); }
change this line
if( bSendScrollingNotification && _psbd.m_bEnabled )
to
if( bSendScrollingNotification && _psbd.m_bEnabled &&
m_nSBMHT == CExtPaintManager::__ESBMHT_THUMB )
seems to fix the problem, any comments ?
thanks
|
|
Technical Support
|
Aug 5, 2008 - 1:22 PM
|
Thank you for reporting us this issue. We agree that thumb button notifications should be sent during thumb button drag-n-drop only. But such notifications are very handy because WM_HSCROLL / WM_VSCROLL message handler methods are getting ready-to-use new scrolling position value. That is why we decided to send thumb button notifications for all the scroll bar events. We have accepted the fix you proposed and the updated version of the CExtScrollBar window will work with any other windows which can work with scroll bar common controls. But some of Prof-UIS classes require the always-sent thumb notifications. So, we will need to support both scroll bar modes. For instance, the CExtNCSB template class requires always-sent notifications and we will need to fix its source code too. We agree that default behavior of the CExtScrollBar class should be exactly the same as behavior of scroll bar common control. Please send us an e-mail to the support mail box and we will reply you with the source code update which contain all the required scroll bar fixes.
|
|
Offer Har
|
Aug 4, 2008 - 4:40 PM
|
I ask again - is there any way to get a better support?
|
|
Technical Support
|
Aug 5, 2008 - 12:47 PM
|
Dear Ron,
We cannot reproduce the problem with item hiding and removing. Wherever we call the following code in the method of the CExtTreeGridWnd -derived class it does not crash:
HTREEITEM htiTop1 = ItemInsert( NULL, ULONG(-1L), 1L, false ); ItemExpand( htiTop1, TVE_EXPAND, false );
HTREEITEM htiChild1ofTop1 = ItemInsert( htiTop1, ULONG(-1L), 1L, false );
HTREEITEM htiChild2ofTop1 = ItemInsert( htiTop1, ULONG(-1L), 1L, false );
HTREEITEM htiTop2 = ItemInsert( NULL, ULONG(-1L), 1L, false ); ItemExpand( htiTop2, TVE_EXPAND, false );
HTREEITEM htiChild1ofTop2 = ItemInsert( htiTop2, ULONG(-1L), 1L, false );
HTREEITEM htiChild2ofTop2 = ItemInsert( htiTop2, ULONG(-1L), 1L, false );
ItemHide( htiTop1, true, false );
ItemRemove(htiChild1ofTop1, false, false);
ItemRemove(htiChild2ofTop1, false, false);
OnSwUpdateScrollBars();
|
|
Offer Har
|
Aug 5, 2008 - 12:54 PM
|
Sent - please let me know you got it or not...
|
|
Technical Support
|
Aug 5, 2008 - 2:17 PM
|
Dear Ron,
Your test project really helped us to find and fix the bug with removing tree rows at the bottom of some hidden tree rows. Thank you. Please update the source code for the following method:
ULONG CExtTreeGridDataProvider::_Tree_NodeRemove(
CExtTreeGridCellNode * pNode,
bool bChildrenOnly // = false
) // returns count of removed items
{
ASSERT_VALID( this );
ASSERT_VALID( pNode );
ASSERT_VALID( m_pCellRoot );
CExtGridDataProvider & _DP = _Tree_GetCacheDP();
ULONG nReservedRowCount = 0;
_DP.CacheReservedCountsGet( NULL, &nReservedRowCount );
ULONG nAdjustOffset = 1;
if( LPVOID(pNode) == LPVOID(m_pCellRoot) )
{
bChildrenOnly = true;
nAdjustOffset = 0;
}
bool bNodeIsHidden = pNode->TreeNodeHiddenGet();
if( bNodeIsHidden )
pNode->TreeNodeHiddenSet( *this, false );
ULONG nCountRemoved = 0,
nIdx,
nChildrenCount = pNode->TreeNodeGetChildCount();
for( nIdx = 0; nIdx < nChildrenCount; nIdx++ )
{
CExtTreeGridCellNode * pChildNode = pNode->TreeNodeGetChildAt( nIdx );
ASSERT_VALID( pChildNode );
ULONG nSubCountRemoved = _Tree_NodeRemove( pChildNode, true );
nCountRemoved += nSubCountRemoved;
}
ULONG nContentWeight = pNode->_ContentWeight_Get( false );
ULONG nOffset = pNode->TreeNodeCalcOffset( false );
bool bDisplayed = pNode->TreeNodeIsDisplayed();
bool bExpanded = pNode->TreeNodeIsExpanded();
ULONG nVisibleOffset = 0;
if( bDisplayed )
nVisibleOffset = pNode->TreeNodeCalcOffset( true, false );
if( nContentWeight > 0 )
{
m_arrGridRef.RemoveAt( nOffset + nAdjustOffset, nContentWeight );
if( bDisplayed && bExpanded )
{
#ifdef _DEBUG
if( LPVOID(pNode) != LPVOID(m_pCellRoot) )
{
CExtTreeGridCellNode * pDebugTestNode = m_arrGridVis.GetAt( nVisibleOffset );
ASSERT_VALID( pDebugTestNode );
ASSERT( LPCVOID(pDebugTestNode) == LPCVOID(pNode) );
}
#endif
ULONG nVisibleContentWeight = pNode->_ContentWeight_CalcVisible();
m_arrGridVis.RemoveAt( nVisibleOffset + nAdjustOffset, nVisibleContentWeight );
pNode->_ContentWeight_Decrement( nVisibleContentWeight, false );
pNode->m_arrChildren.RemoveAll();
}
else
{
pNode->m_arrChildren.RemoveAll();
pNode->_ContentWeight_DecrementNonExpanded( nContentWeight );
pNode->_ContentWeight_Adjust();
}
ASSERT( pNode->_ContentWeight_Get(true) == 0 );
ASSERT( pNode->_ContentWeight_Get(false) == 0 );
nCountRemoved += nContentWeight;
VERIFY( _DP.RowRemove( nOffset + nAdjustOffset + nReservedRowCount, nContentWeight ) );
}
if( ! bChildrenOnly )
{
CExtTreeGridCellNode * pNodeNext = pNode->m_pNodeNext;
CExtTreeGridCellNode * pNodePrev = pNode->m_pNodePrev;
CExtTreeGridCellNode * pNodeParent = pNode->m_pNodeParent;
ASSERT_VALID( pNodeParent );
ULONG nSiblingIdx = pNode->TreeNodeGetSiblingIndex();
if( pNodeNext != NULL )
{
ASSERT_VALID( pNodeNext );
ASSERT( LPCVOID(pNodeNext->m_pNodePrev) == LPCVOID(pNode) );
pNodeNext->m_pNodePrev = pNodePrev;
}
if( pNodePrev != NULL )
{
ASSERT_VALID( pNodePrev );
ASSERT( LPCVOID(pNodePrev->m_pNodeNext) == LPCVOID(pNode) );
pNodePrev->m_pNodeNext = pNodeNext;
}
pNodeParent->m_arrChildren.RemoveAt( nSiblingIdx );
ULONG nResetIdx = nSiblingIdx, nResetCnt = ULONG( pNodeParent->m_arrChildren.GetSize() );
for( ; nResetIdx < nResetCnt; nResetIdx++ )
{
CExtTreeGridCellNode * pNode = (CExtTreeGridCellNode *)
pNodeParent->m_arrChildren.GetAt( nResetIdx );
ASSERT_VALID( pNode );
ASSERT_KINDOF( CExtTreeGridCellNode, pNode );
pNode->m_nOptIndex = nResetIdx;
}
if( bDisplayed )
{
#ifdef _DEBUG
if( LPVOID(pNode) != LPVOID(m_pCellRoot) )
{
CExtTreeGridCellNode * pDebugTestNode = m_arrGridVis.GetAt( nVisibleOffset );
ASSERT_VALID( pDebugTestNode );
ASSERT( LPCVOID(pDebugTestNode) == LPCVOID(pNode) );
}
#endif
m_arrGridVis.RemoveAt( nVisibleOffset );
pNodeParent->_ContentWeight_Decrement( 1, false );
}
else
{
pNodeParent->_ContentWeight_DecrementNonExpanded( 1 );
pNodeParent->_ContentWeight_Adjust();
}
VERIFY( _DP.RowRemove( nOffset + nReservedRowCount ) );
}
return nCountRemoved;
}
|
|
Offer Har
|
Aug 5, 2008 - 2:24 PM
|
Dear Support, Thanks you very much! will try it out soon. Please note that I sent it to you on June 30th... Maybe now is a good time to close all other open issues I reported? Regards, Ron.
|
|
Offer Har
|
Aug 5, 2008 - 12:51 PM
|
Dear Support, I am sending you now via mail an application that demonstrates the bug. Please let me know when you get it and that you were able to reproude the bug. Regards, Ron.
|
|
Wang Hui Qing
|
Aug 4, 2008 - 4:20 AM
|
Dear Tech Support, In MS One Note 2007, a tab window (section as called in One Note) can be freely moved to any notebook. We want to implement similar feature for our MDI document/view application. Prof-UIS provides two types of tab management: CExtTabMdiWnd based and CExtTabPageContainerWnd based control. 1. if use CExtTabMdiWnd, how to control the tabs to be shown in tab window? I tried CExtTabMdiWnd:: ItemRemove(). The tab as specified will disappear at first, however, as window is repaint, the removed tab gets shown in tab window again. I guess it’s because the CExtTabMdiWnd control as defined in CMainFrame by default will tab group all child view windows. Any way to overload it? 2. if use CExtTabPageContainerWnd , I still cannot figure out how to do it appropriately in our existing MDI application, i.e. where to declare the CExtTabPageContainerWnd control (or should inherit CMainFrame from it?), how to invoke PageInsert(..)/PageRemove(..) for Cview-based windows etc.
Which one do you recommend as more efficient for our existing MDI document/view application? Thanks. Hui Qing
|
|
tera t
|
Aug 1, 2008 - 3:17 AM
|
Hello. I want to connect an icon to the non-client area.
|
|
Technical Support
|
Aug 1, 2008 - 12:53 PM
|
The bar caption buttons are instances of CExtBarNcAreaButton . You can find resizable control bars with custom caption buttons in the FixedSizePanels sample. The CNcBackForwardNavigationBtn class in this sample application implements Back/Forward buttons in the caption of resizable bar with Internet Explorer.
|
|
tera t
|
Aug 4, 2008 - 12:16 AM
|
|
|
tera t
|
Aug 1, 2008 - 2:25 AM
|
Hello. I maximize a bar and, to the place of a green arrow, want to display it.
Thanks,
|
|
Technical Support
|
Aug 1, 2008 - 12:53 PM
|
How did you maximize it? What is maximized bar in your message?
|
|
tera t
|
Aug 3, 2008 - 7:24 PM
|
Hello. It is A-Bar. ( CExtControlBar )
|
|
Technical Support
|
Aug 4, 2008 - 2:03 PM
|
In this case you can only resize the separator between the bars manually.
Prof-UIS also supports collapsing/expanding the caption button for resizable control bars. But this button is experimental component and it’s not used by resizable control bars by default.
|
|
Technical Support
|
Aug 4, 2008 - 2:05 PM
|
The caption buttons are initialized in the CExtControlBar::OnNcAreaButtonsReinitialize() virtual method where you can see the initialization of the CExtBarNcAreaButtonExpand button is commented: void CExtControlBar::OnNcAreaButtonsReinitialize()
{
ASSERT_VALID( this );
INT nCountOfNcButtons = NcButtons_GetCount();
if( nCountOfNcButtons > 0 )
return;
NcButtons_Add( new CExtBarNcAreaButtonClose(this) );
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
NcButtons_Add( new CExtBarNcAreaButtonAutoHide(this) );
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
// NcButtons_Add( new CExtBarNcAreaButtonExpand(this) );
NcButtons_Add( new CExtBarNcAreaButtonMenu(this) );
// NcButtons_Add( new CExtBarNcAreaButtonFloatingMaximizeRestore(this) );
} You can override this virtual method in your CExtControlBar -derived class, copy the body from original method and uncomment initialization of the CExtBarNcAreaButtonExpand button.
|
|
howard liu
|
Jul 31, 2008 - 7:23 AM
|
Hi, We have the CExtNCSB wrapper for the scroll bar in our application. Due to this the look and feel of the majority of the scroll bars in our application are like prof-ui sample scroll bars ( i.e. colored), but the scroll bar functionality is lost. We use Prof-ui 2.8.3. Is there a way to get the functionality of these scroll bar correct in addition to having the prof-ui like look and feel. Thanks, Howard
|
|
Jeremy Richards
|
Jul 29, 2008 - 3:37 PM
|
Normally you can enter custom characters by holding ALT then typing a code on the numeric keypad. For instance to type a degree symbol (°) you press Alt and type 248 on the numeric keypad and then release ALT. When you release ALT, a WM_CHAR message is generated with WPARAM=0x000000b0 and LPARAM=0xc0380001 (the flags in the LPARAM can vary). This can be done with many different codes to generate symbols you cannot normally type. However, when using Prof-UIS something goes wrong. The WPARAM=0x0000003f which is the code for question mark. I have verified that this is a problem both in my application and ProfStudio child window of the ProfStudio workspace. Actually in the ProfStudio workspace, typing Alt+248 will type a question mark in the main child window. If you try to type it in any of the combo boxes that are embedded in the toolbars of ProfStudio, then the application will ASSERT instead of typing a question mark (null pointer assertion). In my workspace, this seems to happen in all windows except for children of CDialogs (not necessarily CExtResizableDialogs, which I am not currently using) Is this something you are aware of? Is there any workaround? We have customers who rely on being able to do this for custom character entry.
|
|
Krustys Donuts
|
Jul 29, 2008 - 3:34 PM
|
Dear Support, In my constructor of a CExtResizableDialog derived class I load a PNG file as follows:
//Load the PNG resources for this dialog.VERIFY(_bmpTmp.LoadPNG_File(_T( m_bmpToolSpaceImage = _bmpTmp; "C:\\source\\Studio 2008\\Plugins\\Ziggy\\res\\ToolSpaceImage.png")));
In my OnPaint handler I try to display this png image on the dialog as follows:
void { CPaintDC dc( VRTabChildToolSpace::OnPaint()this); // device context for painting //Get the desired location of the jog tool space image.CRect rect; GetDlgItem(IDC_frmJogToolSpace)->GetWindowRect(rect); ScreenToClient(rect); //Draw the joint space jogging image.m_bmpToolSpaceImage.AlphaBlend(dc.m_hDC, rect); }
Unfortunately, I am not seeing any image on the display. Other png files loaded just as the ToolSpaceImage.png file show up fine on a CExtButton object. I hit a breakpoint in the OnPaint handler as would be expected. Is there an example of the AlphaBlend funciton being used. Am I doing anything wrong?
Thanks,
Gil
|
|
Krustys Donuts
|
Aug 1, 2008 - 10:53 AM
|
Support, You are correct, I am using resizable dialogs. I would like to describe why I want a clickable button on top of a CExtLabel object. On my interface there is an image of a robot gripper. This gripper is equiped with fingers that move in (to grasp) and out (to let go). The picture of the gripper originates from a PNG file and is displayed on the UI via a CExtLabel control (using SetBitmapEx). Via two buttons, I must allow the user to move the fingers of the gripper together and outward. These two buttons are CExtButton derived controls. I would like to position these buttons between the two fingers. Thus, the buttons must go on top of the CExtLabel that shows the gripper image. Is there a better approach to achieving this goal? Gil
|
|
Technical Support
|
Aug 1, 2008 - 12:54 PM
|
It looks like robot UI item in your application is enough specific UI item to code it from scratch. This robot window should be a complete stand-alone window. The buttons for controlling robot part movements should be a custom drawn parts of robot window. Of course, it’s possible to use static picture control as robot window and place push button windows over robot picture window using the SetWindowPos() API, but we think this is not good quality solution.
|
|
Krustys Donuts
|
Jul 31, 2008 - 1:06 PM
|
Dear Support, Your suggestion to use CExtLabel::SetBitmapEx() works great. The only issue is that if there is a CExtButton beneath the CExtLabel control, the button control is not visible. Only when I mouse over the button does it become visible. This behavior is seen when the tabbing order of the CExtLabel control is greater than that of the CExtButton control. Thanks, Gil
|
|
Technical Support
|
Aug 1, 2008 - 3:12 AM
|
If you are using resizable dialogs with anchored controls, then the dialog windows should have the WS_CLIPCHILDREN style for flicker free resizing. This style does not allow dialog controls to intersect with each other and be transparent. Besides, we have no idea when and why in the real life the static label control should be above the clickable input controls such as buttons.
|
|
Technical Support
|
Jul 30, 2008 - 4:35 AM
|
We just sent you the test project which loads PNG file (that was sent us by Gil) successfully.
In addition to comments by Jeremy in this thread we must say the following: there is no difference between the CExtBitmap , CExtBitmapCache and CExtSkinBitmap classes in terms of how they paint bitmaps with alpha-channel. The CExtBitmap class is a base class and it contains 100% of features required for painting any bitmaps. Its key feature is that it’s handle-less. I.e. it does not eat even one GDI handle in comparison with MFC’s CBitmap class. The CExtBitmapCache class eats one GDI’s HBITMAP handle what allows it to paint a bitmap a bit faster, but this is true when running on Windows 2000 or later Windows OS. The CExtSkinBitmap class from the ProfSkin library simply contains methods for PNG format loading. All the classes can draw the same bitmap formats absolutely equally. If the loaded image format is not based on alpha channel, then the CExtBitmap::AlphaBlend() methods simply invoke appropriate CExtBitmap::Draw() methods. But all the CExtBitmap::AlphaBlend() methods work equally to each other and the same is true of all the CExtBitmap::Draw() methods. The overloaded method versions are provided for convenience only. Besides, although Windows OS supports alpha channel bitmap painting only starting from Windows 2000, you can use the CExtBitmap::AlphaBlend() methods in any Windows OS versions starting from Windows 95.
The PNG loading and using in Prof-UIS is exactly the same simple and trivial task as BMP file usage in MFC, We believe the problem is still hidden in something what we haven’t yet discussed If you need a remote desktop connection for fixing this problem, then please let us know.
|
|
Jeremy Richards
|
Jul 29, 2008 - 3:49 PM
|
One other thing. While I have been able to get the CExtSkinBitmap’s PNG support to work and found it adequate for loading and displaying PNGs, if you are going to do anything more sophisticated than just that, you might consider moving to a more extensive image manipulation library, such as CxImage which is free. CxImage is free and offers a much broader range of support as well as it is a little easier (IMO) to work with. Of course CxImage doesn’t give you all the UI elements that Prof-UIS does, so I tend to use both in my projects.
|
|
Jeremy Richards
|
Jul 29, 2008 - 3:45 PM
|
This one took me a while. It appears that not all of the various overrides of that function properly work in a CExtSkinBitmap. I don’t know why, as it seems like it would have been easy to implement. I wanted to use the 2 parameter one at first as well. I finally had to use this one: virtual int AlphaBlend( HDC hDC, int nDstX, int nDstY, int nDstWidth, int nDstHeight, int nSrcX, int nSrcY, int nSrcWidth, int nSrcHeight, BYTE nSCA = 0xFF ) const; Note: Since CExtBitmapCache implements an AlphaBlend as well, you have to actually manually call the one from CExtBitmap like this lockBkgnd->CExtBitmap::AlphaBlend(*dc, ext.right-size.cx-1, ext.bottom-size.cy-1, size.cx, size.cy, 0, 0, size.cx, size.cy, 0x70); Hope this helps
|
|
Jeremy Richards
|
Jul 29, 2008 - 11:26 AM
|
I need to hide a specific auto hide control bar. Here is my code (adapted from your sample code in the FAQ): if (pBar->AutoHideModeGet()) {
pBar->AutoHideModeSet( false, false, true, true );
ASSERT_VALID( pBar->m_pDockSite );
pBar->m_pDockSite->ShowControlBar( pBar, FALSE, FALSE );
} else if { ... } This does not quite work. If the bar is in an autohide tab group it hides the entire group instead of just the one bar I want hidden.
|
|
Technical Support
|
Jul 30, 2008 - 4:22 AM
|
Unfortunately the current version of control bars keeps all the bars in a tabbed group always together linked in the auto hide state. We can regard your message as a feature request.
|
|
Chun Pong Lau
|
Aug 4, 2008 - 10:25 PM
|
May I request this feature (i.e. hiding/showing a tabbed bar) as well? This is very useful.
|
|
howard liu
|
Jul 29, 2008 - 5:21 AM
|
Hi, I want to remove the resizable property for CExtResizablepropertySheet/CExtResizablepropertypage .How Do i achieve it. I tried using showSizeGrip(FALSE) method but it is not working . Also is there any method to set min and max window size of CExtResizablepropertySheet Thanks
|
|
Technical Support
|
Jul 31, 2008 - 4:02 AM
|
The ShowSizeGrip() method is used to hide/show the resizing gripper. It does not modify the WS_THICKFRAME window style, which indicates whether the window is resizable. For dialogs, you need to set the Border property in the dialog editor to Dialog Frame. For CExtResizablePropertySheet , the WS_THICKFRAME window style is turned on by default. To disable resizing, simply remove this style: ModifyStyle( WS_THICKFRAME, 0 );
ShowSizeGrip( FALSE ); As for setting min and max window size there are two methods in CExtWA which allows you to limit the window size: SetMinTrackSize() and SetMaxTrackSize() .
|
|
howard liu
|
Jul 29, 2008 - 5:08 AM
|
Hi, when i apply profui over SDI or MDI appln,I get a profui popup menu (context menu) with option to select/deselect the toolbar/statusbar on the non client area . how do I remove that popup menu. thanks
|
|
Technical Support
|
Jul 31, 2008 - 4:03 AM
|
You can modify or disable any of built-in Prof-UIS popup menus displayed over control bars or frame window areas. You can learn more about this from this article.
|
|
tera t
|
Jul 29, 2008 - 2:48 AM
|
Hello. This dialog Like a pop-up menu,
At the phase that other Window was clicked.
I want to close Dialog automatically. Thank you very much.
|
|
Technical Support
|
Jul 31, 2008 - 4:06 AM
|
You can invoke the CDialog::EndDialog( IDOK ); method when you need to close the dialog.
Also, having the non-modal dialog you can invoke DestroyWindow method for destroying the dialog window.
|
|
tera t
|
Jul 31, 2008 - 3:44 AM
|
Hello. Using SetWindowsHookEx(WM_MOUSE ... , it was able to come true. Thanks,
|
|
tera t
|
Jul 28, 2008 - 7:27 PM
|
Hello. When I did hover, it is painted pictures with black.
I want to display it as a set color even if I do hover. When I set hover color.
When I chose a grid, it is not displayed with white
|
|
Technical Support
|
Aug 1, 2008 - 12:54 PM
|
You should not use __ECS_ALL color adjustment constant in you grid cells if you want to see them using different colors in the normal and selected states. You should use __ECS_NORMAL instead.
|
|
Technical Support
|
Jul 31, 2008 - 4:07 AM
|
It seems you have specified incorrect flags when setting the cell text color. If you are using the __ECS_NORMAL style you should know that it change the text color only in the normal cell state, not hovered, not selected and not highlighted. You the __ECS_ALL flag if you need to change the color in any state.
|
|
tera t
|
Aug 1, 2008 - 2:19 AM
|
Hello. I make a cell __ECS_ALL
When I chose it, the cell becomes the specified color.
When I chose it, I want to display it with white.
|
|
Technical Support
|
Aug 24, 2008 - 11:54 AM
|
There is a CExtGridCell::__ECS_SELECTED flag. Did you try it?
|
|
tera tera
|
Sep 1, 2008 - 1:35 AM
|
Hello. If I do not use __EGBS_EX_HVI_EVENT_CELLS.
It came to be painted pictures well.
When are __ECS_HIGHLIGHT_BY_FOCUS and __ECS_HIGHLIGHT_BY_SELECTION useful ? Color setting is difficult.
I do not come by color setting as expected.
|
|
Technical Support
|
Sep 1, 2008 - 7:42 AM
|
You should use the __EGBS_EX_HVI_EVENT_CELLS style. If this it is set, the inner data grid cells will start receiving mouse hover notifications.
|
|
tera t
|
Aug 21, 2008 - 6:38 PM
|
Hello.
I set a cell as follows.
pCell->TextColorSet( CExtGridCell::__ECS_NORMAL , BLUE );
pCell->BackColorSet( CExtGridCell::__ECS_HOVER , BLUE ); But, to the selection of the cell, I want to display it with white. Is not this made?
|
|
tera t
|
Jul 28, 2008 - 7:16 PM
|
Hello. I want to set gap space.
Thanks,
|
|
Technical Support
|
Jul 31, 2008 - 4:08 AM
|
It seems we already answered a similar question here.
|
|
Krustys Donuts
|
Jul 28, 2008 - 3:31 PM
|
Dear Product Support, I am trying to load a PNG from a resource. The FindResourceHandle routine always returns hInst = 0. The code used to load the resource is as follows: CExtSkinBitmap _bmpTmp; HRSRC hRsrc = NULL; LPCTSTR strPngResourceSection = _T("PNG"); HINSTANCE hInst = g_ResourceManager->FindResourceHandle( strPngResourceSection, IDB_pngJogJointSpace, NULL, &hRsrc ); ASSERT( hInst ); ASSERT( hRsrc ); VERIFY( _bmpTmp.LoadPNG_Resource( hInst, hRsrc ) ); In the resource.h file there is: #define IDB_pngJogJointSpace 411 In the Ziggy.rc file there is: IDB_pngJogJointSpace PNG "res\\JointSpace.png" I have also included the PNG file. Please tell me what I’m doing incorrectly. Thanks, Gil Ross
|
|
Technical Support
|
Jul 30, 2008 - 4:03 AM
|
The PNG file is loaded successfully in the following simplest possible test project:
http://www.prof-uis.com/download/forums/TestPng.zip
It uses your PNG loading source code. So, the problem is hidden somewhere else. We suspect your project configures the resource manager in some special way so it cannot find the appropriate PNG resource
|
|
Jeremy Richards
|
Jul 29, 2008 - 11:19 AM
|
Well, I recently tried doing this in a legacy Prof-UIS app. Here is what I came up with: bool CPngBitmap::LoadFromResource(UINT resID) {
Empty();
LPCTSTR strPngImageResourceID = MAKEINTRESOURCE( resID );
LPCTSTR strPngResourceSection = _T("PNG");
HINSTANCE hInst = ::AfxFindResourceHandle( strPngImageResourceID, strPngResourceSection );
ASSERT( hInst );
HRSRC hRsrc = ::FindResource( hInst, strPngImageResourceID, strPngResourceSection );
ASSERT( hRsrc );
bool retVal = LoadPNG_Resource( hInst, hRsrc );
ASSERT(retVal);
return retVal;
} The only real difference that I can see is that I call ::AfxFindResourceHandle instead of using g_ResourceManager. It seems clear we both copied the example code provided. Mine works fine. My resource is directly in the .exe itself, and not loaded by any DLLs.
|
|
Krustys Donuts
|
Jul 28, 2008 - 12:59 PM
|
On June 13, 2008, in the Support Forum, you answered a question with subject "Getting tab order to work correctly with a Dialog->Tab Control->Dialog". I am trying to make the tabbing order work correctly for my project as well. From the given answer, it seems that I need some new code to fix this problem. Could you please send me this code (gross@velocity11.com) or tell me what is needed to fix this issue. Thanks, Gil
|
|
Technical Support
|
Jul 30, 2008 - 4:18 AM
|
We have sent the download details to the specified email address.
|
|
Offer Har
|
Jul 28, 2008 - 12:13 PM
|
Please contact us via mail or phone please, ASAP
|
|
Offer Har
|
Aug 3, 2008 - 4:19 PM
|
|
|
Technical Support
|
Jul 28, 2008 - 12:38 PM
|
We are sorry but if you mean your last message ("I sent you an exact scenario when this bug happens."), we still have not received it. Did you send it today?
|
|
Offer Har
|
Aug 3, 2008 - 4:19 PM
|
|
|
Marc Thompson
|
Jul 28, 2008 - 12:40 AM
|
We have a standard MFC application with the latest Prof-UIS extensions added (2.83), which has fixed the problem with child windows not correctly skinned (excellent work), but we have a CListView derived view class now loses its header control when the view is maximised. I tried the
CExtNCSB wrapping the CListView, but this caused assertions during the subclassing of the view.
Have you had experience of this, and is there a simple fix to it? I dont really want to change to a grid for this.
Thanks
Marc Thompson
|
|
Marc Thompson
|
Jul 28, 2008 - 5:28 PM
|
Thanks for the quick response, but unfortunately it hasnt solved the problem. The class is still causing an assertion in the PreSubclassWindow function. Below is the call stack immediately before the assertion. mfc80d.dll!AfxAssertFailedLine(const char * lpszFileName=0x781d54e0, int nLine=626) Line 25 + 0x14 bytes C++
mfc80d.dll!AfxHookWindowCreate(CWnd * pWnd=0x04c1c190) Line 626 + 0x18 bytes C++
mfc80d.dll!CWnd::CreateEx(unsigned long dwExStyle=1048576, const char * lpszClassName=0x03028bb4, const char * lpszWindowName=0x03028b94, unsigned long dwStyle=1174405120, int x=0, int y=0, int nWidth=0, int nHeight=0, HWND__ * hWndParent=0x00010016, HMENU__ * nIDorHMenu=0xffffffff, void * lpParam=0x00000000) Line 694 C++
mfc80d.dll!CWnd::CreateEx(unsigned long dwExStyle=1048576, const char * lpszClassName=0x03028bb4, const char * lpszWindowName=0x03028b94, unsigned long dwStyle=1174405120, const tagRECT & rect={...}, CWnd * pParentWnd=0x0656ecb0, unsigned int nID=4294967295, void * lpParam=0x00000000) Line 659 C++
ProfUIS283md.dll!CExtNCSB_ScrollContainer::Create(CWnd * pWndParent=0x0656ecb0) Line 2628 + 0x28 bytes C++
3DOffice.exe!CExtNCSB_Impl<CListView>::NCSB_InstantiateAndCreateContainer(CExtNCSB_ScrollContainer::e_mode_t eMode=__EM_HORIZONTAL_SCROLL_BAR, CWnd * pWndParent=0x0656ecb0) Line 556 + 0x14 bytes C++
3DOffice.exe!CExtNCSB_Impl<CListView>::NCSB_EnsureContainersCreated() Line 591 + 0x16 bytes C++
3DOffice.exe!CExtNCSB_Impl<CListView>::NCSB_RepositionContainers(bool bRescanScrollPositions=true) Line 772 + 0x10 bytes C++
3DOffice.exe!CExtNCSB_Impl<CListView>::PreSubclassWindow() Line 930 C++
mfc80d.dll!_AfxCbtFilterHook(int code=3, unsigned int wParam=134894, long lParam=1236256) Line 532 C++ Cheers Marc Thompson
|
|
Technical Support
|
Jul 29, 2008 - 12:54 PM
|
Please add explicit invocation of parent class constructor to your list view class constructor: CYourListView::CYourListView()
: CExtNCSB < CListView > ( true )
{
} This informs the CExtNCSB template class that it should initialize its scroll bar windows with delay to avoid conflicts with window creation sequences implemented inside MFC. There is another feature in the CExtNCSB template class: it can create a middle container window between the control with skinned scroll bars and the control’s parent window. This feature is required for using CExtNCSB template class inside control bars. The CExtControlBar control bar window requires only one child window inside it and it resizes its single child window automatically to cover the entire control bar’s client area. If you need to create a list view control with CExtNCSB -based skinned scroll bars inside a control bar, there are three windows will appear inside the bar: the list view common control and two CExtScrollBar windows (horizontal and vertical). To avoid such a conflict with the design of CExtControlBar window, you should allow the CExtNCSB template class to create a dynamic container window which will be a child of the control bar and the parent of list view common control with its skinned scroll bars. In this case, you also need explicit parent constructor invocation in list view control’s constructor: CYourListCtrl::CYourListCtrl()
: CExtNCSB < CListCtrl > ( true, true )
{
}
|
|
Technical Support
|
Jul 28, 2008 - 9:23 AM
|
You can use CExtNCSB for skinning any windows except CListCtrl and CListView . The list view common control uses very specific scrolling behavior implementation. The new CExtListCtrl class with skinned CExtHeaderCtrl will appear in v.2.84. Here is the beta preview:
NewControls-beta-test2.zip
The list view common control requires a specialized version of CExtNCSB template < > class CExtNCSB < CListCtrl > : public CExtNCSB_Impl < CListCtrl >
{
public:
CExtNCSB(
bool bNcsbDelayedInitialization = false,
bool bNcsbForceMiddleContainerMode = false
)
: CExtNCSB_Impl < CListCtrl > (
bNcsbDelayedInitialization,
bNcsbForceMiddleContainerMode
)
{
}
virtual ~CExtNCSB()
{
}
virtual LRESULT WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
{
switch( message )
{
case WM_HSCROLL:
{
UINT nSBCode = UINT(LOWORD(DWORD(wParam))), nPos = UINT(HIWORD(DWORD(wParam)));
//TRACE2( "WM_HSCROLL, nSBCode = %d, nPos = %d\r\n", nSBCode, nPos );
INT nItemExtent = 1;
DWORD dwStyle = GetStyle();
DWORD dwListCtrlType = dwStyle&LVS_TYPEMASK;
switch( dwListCtrlType )
{
case LVS_ICON:
case LVS_SMALLICON:
case LVS_REPORT:
break;
case LVS_LIST:
{
CRect rcItem( 0, 0, 0, 0 );
INT nTopIndex = GetTopIndex();
if( nTopIndex >= 0
&& CListCtrl::GetItemRect( nTopIndex, &rcItem, LVIR_BOUNDS )
)
nItemExtent = rcItem.Width();
}
break;
} // switch( dwListCtrlType )
if( nSBCode == SB_THUMBTRACK || nSBCode == SB_THUMBPOSITION )
{
INT nPosOld = GetScrollPos( SB_HORZ );
INT nPosShift = nPos*nItemExtent - nPosOld*nItemExtent;
Scroll( CSize( nPosShift, 0 ) );
return 0L;
}
if( nSBCode == SB_LINELEFT
|| nSBCode == SB_LINERIGHT
|| nSBCode == SB_PAGELEFT
|| nSBCode == SB_PAGERIGHT
|| nSBCode == SB_LEFT
|| nSBCode == SB_RIGHT
|| nSBCode == SB_ENDSCROLL
)
return 0L;
} // case WM_HSCROLL:
break; // case WM_VSCROLL
case WM_VSCROLL:
{
UINT nSBCode = UINT(LOWORD(DWORD(wParam))), nPos = UINT(HIWORD(DWORD(wParam)));
//TRACE2( "WM_VSCROLL, nSBCode = %d, nPos = %d\r\n", nSBCode, nPos );
INT nItemExtent = 1;
DWORD dwStyle = GetStyle();
DWORD dwListCtrlType = dwStyle&LVS_TYPEMASK;
switch( dwListCtrlType )
{
case LVS_ICON:
case LVS_SMALLICON:
case LVS_LIST:
break;
case LVS_REPORT:
{
CRect rcItem( 0, 0, 0, 0 );
INT nTopIndex = GetTopIndex();
if( nTopIndex >= 0
&& CListCtrl::GetItemRect( nTopIndex, &rcItem, LVIR_BOUNDS )
)
nItemExtent = rcItem.Height();
else
{
TEXTMETRIC _tm;
::memset( &_tm, 0, sizeof(TEXTMETRIC) );
CClientDC dc( this );
CFont * pFont = GetFont();
int nSave = dc.SaveDC();
dc.SelectObject( pFont );
dc.GetTextMetrics( &_tm );
nItemExtent = _tm.tmHeight + _tm.tmExternalLeading + 1;
dc.RestoreDC( nSave );
}
}
break;
} // switch( dwListCtrlType )
if( nSBCode == SB_THUMBTRACK || nSBCode == SB_THUMBPOSITION )
{
INT nPosOld = GetScrollPos( SB_VERT );
INT nPosShift = nPos*nItemExtent - nPosOld*nItemExtent;
Scroll( CSize( 0, nPosShift ) );
return 0L;
}
if( nSBCode == SB_LINEUP
|| nSBCode == SB_LINEDOWN
|| nSBCode == SB_PAGEUP
|| nSBCode == SB_PAGEDOWN
|| nSBCode == SB_TOP
|| nSBCode == SB_BOTTOM
|| nSBCode == SB_ENDSCROLL
)
return 0L;
}
break; // case WM_VSCROLL
} // switch( message )
LRESULT lResult = CExtNCSB_Impl < CListCtrl > :: WindowProc( message, wParam, lParam );
return lResult;
}
}; // template < > class CExtNCSB < CListCtrl > The specialized version above is designed for the CListCtrl class. You can copy it into your project and replace the CListCtrl class name with the CListView class name. As a result, you will have the CExtNCSB < CListView > specialized template class in scope of your project. The CExtNCSB < CListView > class should be before its usage in your project and you should rebuild your project completely to see correctly working list view.
|