Subject |
Author |
Date |
|
Neville Franks
|
Oct 26, 2008 - 6:57 PM
|
CMainFrame::OnSysCommand() is not called when Skinned UI Theme in use. ex. Obsidian. This appears to be because CExtNCW::WindowProc() doesn’t call _BTNCW::WindowProc() because NcFrameImpl_IsSupported() returns true when Obsidian etc. is in use. This prevents me capturing click on Minimize button et.all. Is there a work-around for this? And will it be fixed in a future release? Thanks, Neville http://www.surfulater.com
|
|
Technical Support
|
Oct 27, 2008 - 4:14 AM
|
You can also handle the WM_SYSCOMMAND message in your CMainFrame::WindowProc() virtual method.
|
|
Offer Har
|
Oct 26, 2008 - 7:20 AM
|
Hi, I would like the tab control to not appear unless I have more then one tab, like it’s done in FireFox. Is this possible? Another option we consider is to implement the ’New Tab’ option in IE7/8 - is this possible? Thanks, Ron.
|
|
Technical Support
|
Oct 27, 2008 - 2:15 PM
|
The CExtTabWnd::OnTabWndSyncVisibility() virtual method is invoked to show or hide the tab control when needed. You should hide your tab control if it contains only one tab item. You should invoke the parent class’s method otherwise. The new tab option is very easy to do. You should simply insert one additional tab item to the end and catch its selection in the CExtTabWnd::OnTabWndSelectionChange() method. Besides, if you are interested in IE7-like looking tab control, then please take a look at the following project:
http://www.prof-uis.com//download/forums/TestIE7Tabs.zip
|
|
Ulrich Heinicke
|
Oct 25, 2008 - 1:33 PM
|
Hi, i have a database with some PNG image into and want to you this image as RibbonButton. The class CExtSkinButton can only load PNG file form the resource or a file, but i receive the data from the database into a buffer. So i need a function in CExtSkinButton to load the PNG from the memory. How can i do this? Thanks Ulrich
|
|
Technical Support
|
Oct 27, 2008 - 3:58 AM
|
If you load a PNG from a file on disk or from database into memory buffer, then you can load it from memory buffer into a CExtBitmap object using the CExtSkinBitmap::LoadPNG() method. This means you should use the CExtSkinBitmap class from the ProfSkin library instead of the CExtBitmap class fromProf-UIS. The CExtSkinBitmap class is based on code>CExtBitmap</code> and adds support for PNG images. The CExtSkinBitmap::LoadPNG() method requires a CArchive() object. You should initialize the CMemFile() object on existing memory buffer with PNG file content first. Then you will need to initialize CArchive() object referred to CMemFile() object. Please take a look at how the CMemFile() class is used in Prof-UIS source code, where you can find several ready to use code snippets.
|
|
Offer Har
|
Oct 24, 2008 - 5:34 AM
|
You said it will be be out mid September. Can you provide a feature list & bug fix for this version?
|
|
Offer Har
|
Oct 24, 2008 - 5:33 AM
|
|
|
Neville Franks
|
Oct 23, 2008 - 4:36 PM
|
|
|
Technical Support
|
Oct 27, 2008 - 2:27 PM
|
It seems we answered your questions in the forum you are referring to. If not, just let us know.
|
|
Offer Har
|
Oct 23, 2008 - 8:25 AM
|
Please answer pending questions. Thanks.
|
|
Technical Support
|
Oct 23, 2008 - 2:14 PM
|
|
|
Offer Har
|
Oct 23, 2008 - 3:30 PM
|
Can I get the source-code for it as well? The sorting does not work in this sample application.... clicking the column header and also the icon and selecting the sort A-Z Z-A does not do anything. Please check...
|
|
Offer Har
|
Oct 23, 2008 - 3:25 PM
|
|
|
tera tera
|
Oct 23, 2008 - 2:54 AM
|
Hello. I want to make the page of the tab hide. Or is it necessary to remake a tab every time? Thanks,
|
|
Technical Support
|
Oct 23, 2008 - 2:00 PM
|
The CExtTabPageContainerWnd::PageVisibleGet() and CExtTabPageContainerWnd::PageVisibleSet() methods allow you to work with hidden tab pages.
|
|
Christopher Favreau
|
Oct 22, 2008 - 3:19 PM
|
I am attempting to make a CExtControlBar and its child semi transparent. Here is my code: // Set the status window transparent
if (m_wndECBStatus.ModifyStyleEx(0, WS_EX_LAYERED | WS_EX_TRANSPARENT, 0) == 0)
{
TRACE("Failed to ModifyStyleEx on the Status Window! ERROR(%u)\n", GetLastError());
}
if (m_wndECBStatus.SetLayeredWindowAttributes(0, 0, LWA_ALPHA) == 0)
{
TRACE("Failed to SetLayeredWindowAttributes on Status Window! ERROR(%u)\n", GetLastError());
} The call to SetLayeredWindowAttributes always fails with error code 87. The documentation says that 87 means invalid parameter. The only thing that I can find as far as a reason why is that the control bar is being created with the WS_CHILD attribute. I have read that a window needs the WS_OVERLAPPED or WS_POPUP attribute and will not work with WS_CHILD windows. I have tried the WS_OVERLAPPED attribute but it still does not work. I have also tried WS_POPUP however it trips an ASSERT in the Create function of CWnd (I think). Do you have any suggestions as to how I may make this work? Thanks in advance,
Chris F.
|
|
Technical Support
|
Oct 23, 2008 - 2:03 PM
|
Actually a floating control bar is made up of three windows:
1) The floating mini frame window (also known as a floating palette window). It is a CExtMiniDockFrameWnd window in the case of Prof-UIS. It is a CMiniDockFrameWnd window in the case of MFC. Both are kind of CFrameWnd . So, invoking control bar’s GetParentFrame() method returns a pointer to the main frame for docked control bars and a pointer to the floating palette frame for floating control bars.
2) The child of the floating palette frame window is dock bar window (CDockBar ). It completely covers client area of its parent floating palette window.
3) The dock bar’s child is control bar which is switched into floating state.
Such construction is required because parent window of re-dockable control bar is always dock bar window both in MFC and Prof-UIS. You should make the floating palette frame window layered - not the control bar window. You should use your own CExtControlBar -derived class which implements the CExtControlBar::OnCreateFloatingFrame() virtual method. Your implementation of this virtual method should be similar to original but it should make the floating palette frame window layered with required transparency level.
|
|
Jeremy Richards
|
Oct 23, 2008 - 8:03 AM
|
Layered windows MUST be top level windows, they cannot be child windows. You cannot make a control bar semi transparent, unless it is floating. You could probably make the frame holding a floating control bar semi-transparent, although that could get complex real quickly if you can dock the windows together or form tab groups with them.
|
|
tera tera
|
Oct 22, 2008 - 2:01 AM
|
|
|
Technical Support
|
Oct 23, 2008 - 2:10 PM
|
It looks like you are using screen coordinates somewhere where client coordinates should be used instead.
|
|
tera tera
|
Oct 24, 2008 - 12:30 AM
|
Hello. I cannot understand a revision point.
Please revise a sample.
Give my best regards.
|
|
Technical Support
|
Oct 25, 2008 - 8:35 AM
|
|
|
Offer Har
|
Oct 27, 2008 - 2:54 PM
|
Dear Support, I have a need for the same feature - I see that when I change the text, the balloon flickers heavily - can this be fixed? It is very hard on the eye like this... Thanks, Ron.
|
|
tera tera
|
Oct 26, 2008 - 10:35 PM
|
Hello. The application does not work definitely.
A tool tip is displayed in the improper place.
|
|
Technical Support
|
Oct 27, 2008 - 2:23 PM
|
We do not believe in magic. Could you please let us connect to your computer and debug this test project? If yes, then please drop us an e-mail with information about how and when should we connect?
|
|
tera tera
|
Oct 27, 2008 - 6:58 PM
|
Hello. I made the following points comment out. virtual LRESULT WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
{
/*
if( message == WM_WINDOWPOSCHANGING )
m_rcExcludeArea.SetRect( -32766, -32766, 32766, 32766 );
*/
return CExtPopupMenuTipWnd::WindowProc( message, wParam, lParam );
} Thanks,
|
|
tera tera
|
Oct 21, 2008 - 10:04 PM
|
Hello. I want to display the character string of the list of combos in right justify.
|
|
Technical Support
|
Oct 25, 2008 - 8:40 AM
|
It is possible only if you create a CExtGridCellComboBox -derived class and override the CExtGridCellComboBox::OnPopupListBoxItemDraw() virtual method in it. This method is used to draw each item in a combo box. Just copy the original method code and change the text aligning flag (DT_LEFT to DT_RIGHT ).
|
|
tera tera
|
Oct 24, 2008 - 12:43 AM
|
|
|
Thomas Roeder
|
Oct 21, 2008 - 4:00 PM
|
Hi, I’m trying to compile this scripting example, but have some problems with that. First I can not register the ProfUIS226md.dll and ProfAuto226md.dll Getting RegSvr32 error: LoadLibrary(...)failed - The specified module can not be found. And during the linkage I get: 1>Linking... 1>MainFrm.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall CExtCustomizeSite::GetToolbarCustomizeInfo(class CExtToolControlBar *,class CExtCustomizeCmdTreeNode * *,class CExtCustomizeCmdTreeNode * *,class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > *,bool *)" (?GetToolbarCustomizeInfo@CExtCustomizeSite@@UAE_NPAVCExtToolControlBar@@PAPAVCExtCustomizeCmdTreeNode@@1PAV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@PA_N@Z) 1>MainFrm.obj : error LNK2001: unresolved external symbol "public: virtual class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > __thiscall CExtCustomizeSite::OnFormatCmdAccelText(class CExtCustomizeSite::CCmdKeyInfo const &)" (?OnFormatCmdAccelText@CExtCustomizeSite@@UAE?AV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@ABVCCmdKeyInfo@1@@Z) 1>MainFrm.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CAutoCustomizeSite::OnTextFieldInplaceTextGet(class CExtBarTextFieldButton const *,class CExtCustomizeCmdTreeNode const *,class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > &)" (?OnTextFieldInplaceTextGet@CAutoCustomizeSite@@UAEXPBVCExtBarTextFieldButton@@PBVCExtCustomizeCmdTreeNode@@AAV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z) 1>MainFrm.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CAutoCustomizeSite::OnTextFieldInplaceTextSet(class CExtBarTextFieldButton *,class CExtCustomizeCmdTreeNode *,class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > &,char const *)" (?OnTextFieldInplaceTextSet@CAutoCustomizeSite@@UAEXPAVCExtBarTextFieldButton@@PAVCExtCustomizeCmdTreeNode@@AAV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@PBD@Z) 1>MainFrm.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall CExtCustomizeSite::OnColorItemGetBtnTextDefault(class CExtBarColorButton *,class CExtCustomizeCmdTreeNode *,class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > &)" (?OnColorItemGetBtnTextDefault@CExtCustomizeSite@@UAE_NPAVCExtBarColorButton@@PAVCExtCustomizeCmdTreeNode@@AAV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z) 1>MainFrm.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall CExtCustomizeSite::OnColorItemGetBtnTextCustom(class CExtBarColorButton *,class CExtCustomizeCmdTreeNode *,class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > &)" (?OnColorItemGetBtnTextCustom@CExtCustomizeSite@@UAE_NPAVCExtBarColorButton@@PAVCExtCustomizeCmdTreeNode@@AAV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z) 1>.\Debug/ProfUISTestScripting.exe : fatal error LNK1120: 6 unresolved externals - Could you pleace tell me what is wrong, or fix the example to current version ProfUis283. Thanks in advance.
|
|
Technical Support
|
Oct 23, 2008 - 2:09 PM
|
It looks like you are using Visual Studio .NET or later Visual Studio version and you are trying to compile a sample project using one compiler settings when Prof-UIS library was compiled with other compiler settings. Such error can occur if you have changed the Native wchar_t usage option. Please make this option in the settings of the test project equal to the same option in the Prof-UIS library project.
|
|
Krustys Donuts
|
Oct 21, 2008 - 11:20 AM
|
Dear Support, I have a CExtButton object that displays an icon only. That is, no text. The problem is when this button has the focus, the focus rectangle is not displayed. If text is added to this button, the focus rectangle is shown (around the text) as expected. How, when the button is icon only, can I get the focus rectangle to display? I have another bitmap that should be used when the button has the focus, but I do not know to which CExtButton member variable this icon should be assigned. Thanks, Gil
|
|
Technical Support
|
Oct 21, 2008 - 1:11 PM
|
The following class will appear in Prof-UIS 2.84 so you can put it at the end of .../Include/ExtButton.h and .../Src/ExtButton.cpp files and use in your project(s): /////////////////////////////////////////////////////////////////////////////
// CExtIconButton
class __PROF_UIS_API CExtIconButton : public CExtButton
{
public:
DECLARE_DYNCREATE( CExtIconButton );
CExtIconButton();
virtual ~CExtIconButton();
CRect m_rcFocusRectPadding;
// Overrides
//{{AFX_VIRTUAL(CExtIconButton)
//}}AFX_VIRTUAL
//{{AFX_MSG(CExtIconButton)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
virtual void _RenderImpl( // buffered paint
CDC & dc,
bool bTransparent = false,
bool bCombinedContent = false
);
}; /// class CExtIconButton
/////////////////////////////////////////////////////////////////////////////
// CExtIconButton
IMPLEMENT_DYNCREATE( CExtIconButton, CExtButton );
CExtIconButton::CExtIconButton()
: m_rcFocusRectPadding( 1, 1, 1, 1 )
{
}
CExtIconButton::~CExtIconButton()
{
}
BEGIN_MESSAGE_MAP( CExtIconButton, CExtButton )
//{{AFX_MSG_MAP(CExtIconButton)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CExtIconButton::_RenderImpl(
CDC & dc,
bool bTransparent, // = false
bool bCombinedContent // = false
)
{
ASSERT_VALID( this );
m_bSeparatedDropDown = false; // should never become a split button
CExtPaintManager * pPM = PmBridge_GetPM();
ASSERT_VALID( pPM );
CRect rcClient;
GetClientRect( &rcClient );
COLORREF clrBackground = GetBkColor();
if( (! bTransparent )
// && (! (bHover || bPushed) )
&& pPM->GetCb2DbTransparentMode(this)
&& ( clrBackground == COLORREF(-1L) )
)
{
CExtPaintManager::stat_ExcludeChildAreas(
dc,
GetSafeHwnd(),
CExtPaintManager::stat_DefExcludeChildAreaCallback
);
if( pPM->PaintDockerBkgnd( true, dc, this ) )
bTransparent = true;
}
if( ! bTransparent )
dc.FillSolidRect(
&rcClient,
(clrBackground != COLORREF(-1L))
? clrBackground
: pPM->GetColor( CExtPaintManager::CLR_3DFACE_OUT, this )
);
if( ! m_icon.IsEmpty() )
{
//bool bDefault = GetDefault() ? true : false;
bool bPushed = m_bPushed ? true : false;
bool bEnabled = OnQueryWindowEnabledState();
//bool bFlat = GetFlat() ? true : false;
bool bHover = ( m_bMouseOver && !CExtPopupMenuWnd::IsMenuTracking() ) ? true : false;
CExtCmdIcon::e_paint_type_t ePT =
bEnabled
? ( bPushed
? CExtCmdIcon::__PAINT_PRESSED
: ( bHover
? CExtCmdIcon::__PAINT_HOVER
: CExtCmdIcon::__PAINT_NORMAL
)
)
: CExtCmdIcon::__PAINT_DISABLED
;
CSize _sizeClient = rcClient.Size();
CSize _sizeIcon = m_icon.GetSize();
CRect rcIcon(
rcClient.left,
rcClient.top,
rcClient.left + _sizeIcon.cx,
rcClient.top + _sizeIcon.cy
);
if( _sizeClient != _sizeIcon )
rcIcon.OffsetRect(
( _sizeClient.cx - _sizeIcon.cx ) / 2,
( _sizeClient.cy - _sizeIcon.cy ) / 2
);
m_icon.Paint( pPM, dc.m_hDC, rcIcon, ePT );
} // if( ! m_icon.IsEmpty() )
bool bDrawFocusRect = ( (!bCombinedContent) && GetFocus() == this && m_bDrawFocusRect ) ? true : false;
if( GetParent()->IsKindOf(RUNTIME_CLASS(CControlBar)) )
{
bDrawFocusRect = false;
//bFlat = true;
}
if( bDrawFocusRect )
{
CRect rcFocus( rcClient );
rcFocus.DeflateRect( &m_rcFocusRectPadding );
dc.DrawFocusRect( &rcClient );
}
}
|
|
Peter Meier
|
Oct 21, 2008 - 10:32 AM
|
Hi The following statement seems not to be working in the V2.83: m_treeGrid.ItemEnsureExpanded(hTreeItem, true);
If I replace it with the following, everything works well:
if (!m_treeGrid.ItemIsExpanded(hTreeItem))
{
m_treeGrid.ItemExpand(hTreeItem, TVE_EXPAND, true);
} These code snippets should be equivalent, right? To me it seems to be a bug, or then I do not understand the ItemEnsureExpanded propperly. Regards - Peter
|
|
Technical Support
|
Oct 21, 2008 - 1:10 PM
|
The CExtTreeGridWnd::ItemEnsureExpanded() method does not change the expanded state of the specified tree item. It makes each tree item in chain of parent tree items expanded. As a result the specified tree item becomes available in the vertically scrollable range of tree rows. So, you should simply invoke the m_treeGrid.ItemIsExpanded(hTreeItem); code without if statement and then invoke the _treeGrid.ItemExpand(hTreeItem, TVE_EXPAND, true); code.
|
|
Robert Webb
|
Oct 21, 2008 - 1:20 AM
|
It’s not uncommon to have two controls in the interface which lead to the same command, however Prof-UIS wants to give them all the same label, which is not always appropriate.
For example, my main menu may have "Tools->Render->Options" whereas elsewhere the same item may be accessible via a small menu that opens off a toolbar button, and there the item may be labelled "Render Options". The point being that the label is different for those two items (the label for the first item just being "Options").
We have quite a few examples like this in our interface. But when I change the label on one item, Prof-UIS changes the other too. OK, if I tell it to change the label for a specific command ID that would make sense, but when I set the label for a given menu item, it should not change others with the same ID. And if I load a new menu, it should not change existing menu labels where IDs match.
Same applies to toolbar buttons too, where icons and text are both forced to be the same where IDs match.
This would be a good default, but is it really impossible to avoid for specific controls?
Thanks,
Rob.
|
|
Technical Support
|
Nov 3, 2008 - 1:57 PM
|
Your task requires a different solution. You cannot use generated HMENU as is because customizable toolbars and menus are based on command tree nodes rather than on Win32 menu handles. You should code a small recursive function which creates command tree nodes with CExtCustomizeCmdTreeNode objects created from the generated menu tree structure. The root of this command tree should be the one which corresponds to a toolbar button. If this node has child nodes, the toolbar button is a drop-down button. The child nodes will be used for creating a popup menu displayed by this toolbar button. This task requires knowing additional details because of:
1) The user can drag-n-drop and clone toolbar buttons and menu items:
2) Each toolbar has two command trees: initial and current. The current one describes displayed buttons and sub menus. The initial one is used for resetting the toolbar by re-creation of the current tree from the initial one.
There is an alternative and not complicated approach for displaying your dynamically constructed HMENU tree. You can use some command with known ID_MY_MARKER_COMMAND identifier in menus and handle the CExtPopupMenuWnd::g_nMsgPrepareOneMenuLevel registered message which allows you to construct and/or modify each popup menu sub level between it will appear first time on the screen. Your handler method will search for the ID_MY_MARKER_COMMAND menu command item, remove it and insert menu items from your dynamically constructed HMENU tree into the same place. For instance, the DRAWCLI sample application have such marker items in menus where you can see the Recent File marker menu item in File menu and OLE VERBS GO HERE maker command in Edit menu of menu bar. This approach automatically solves all the issues related to cloned copies of the ID_MY_MARKER_COMMAND command in all the menus. You can use the CExtPopupMenuWnd::ItemInsertCommand() method for dynamic menu construction. You can assign icons to menu items which are not based in the command manager. You can get icons from the command manager using the CExtCmdManager::CmdGetIconPtr() method. This approach allows you to construct fully working menus identical to your your dynamically constructed HMENU tree.
|
|
Robert Webb
|
Nov 5, 2008 - 12:15 AM
|
I tried your idea of creating a tree of CExtCustomizeCmdTreeNode. But now my buttons don’t appear as drop-downs at all. I’m calling CExtBarButton::SetBasicCmdNode() with the root of my CExtCustomizeCmdTreeNode tree. I have deleted the customization data (which we have in a file rather than the registry). I’m also calling CExtBarButton::SetSeparatedDropDown() and CExtBarButton::SetAutoChangeID() and CExtCmdItem::StateSetSeparatedDD(), but none of these make a difference. The button no longer has a drop-down. Any ideas? Thanks,
Rob.
|
|
Technical Support
|
Nov 7, 2008 - 5:05 AM
|
We think we can help you better if you describe your task as a list of several items so we can try to implement it in a test project or in any of our sample applications. Alternatively, you can send us your test or real project so we can check what’s wrong.
|
|
Robert Webb
|
Nov 5, 2008 - 4:28 PM
|
This forum makes it difficult to spot new posts, so I’m not sure if you saw my second reply yesterday: ==========================
I tried your idea of creating a tree of CExtCustomizeCmdTreeNode. But now my buttons don’t appear as drop-downs at all. I’m calling CExtBarButton::SetBasicCmdNode() with the root of my CExtCustomizeCmdTreeNode tree. I have deleted the customization data (which we have in a file rather than the registry). I’m also calling CExtBarButton::SetSeparatedDropDown() and CExtBarButton::SetAutoChangeID() and CExtCmdItem::StateSetSeparatedDD(), but none of these make a difference. The button no longer has a drop-down. Any ideas?
========================== It seems like this method should be less convoluted than the other, but I can’t even get the button to show a drop-down. What am I missing? Is there a sample that uses this method? Thanks,
Rob.
|
|
Technical Support
|
Nov 7, 2008 - 5:06 AM
|
We think we can help you better if you describe your task as a list of several items so we can try to implement it in a test project or in any of our sample applications. Alternatively, you can send us your test or real project so we can check what’s wrong.
|
|
Robert Webb
|
Nov 4, 2008 - 5:39 PM
|
Thanks for the suggestion. However we’d like our toolbar drop-down menus to be tear-offs, and it seems that the second technique you describe (using g_nMsgPrepareOneMenuLevel) might have problems with that. Is that right? Would the first technique work? (Create tree of CExtCustomizeCmdTreeNode ). Thanks, Rob.
|
|
Technical Support
|
Nov 5, 2008 - 12:41 PM
|
No. We need to explain you some details about tear-off menus:
1) Tear-off menu can be connected to any CExtControlBar -based control bar - not only to CExtToolControlBar toolbar.
2) The CExtPopupMenuWnd should have the TPMX_TEAROFF flag (you can set it using the CExtPopupMenuWnd::TrackFlagsSet() method) and the CExtPopupMenuWnd::_IsTearOff() virtual method should return true value. In case of non-customizable menus you will need to use your own-derived class and implement this virtual method. This is convenient if your popup menus are created dynamically. You can insert your popup menu class instance as sub-menu into other popup menu using the CExtPopupMenuWnd::ItemInsertSpecPopup() method.
3) The window which handle is specified in the hWndCmdRecv parameter in invocation of the CExtPopupMenuWnd::LoadMenu() , CExtPopupMenuWnd::UpdateFromMenu() or CExtPopupMenuWnd::CreatePopupMenu() should handle the CExtPopupMenuWnd::g_nMsgTearOff registered message like the CExtCustomizeSite::OnHookWndMsg() method does. It should initialize the m_hWndTearOff property of data structure passed in message parameters with window handle of control bar window used in tear off effect tracking.
That’s all.
|
|
Technical Support
|
Oct 21, 2008 - 1:09 PM
|
By default all toolbar buttons and menu items are based on CExtCmdItem command descriptions in the command manager. In the case of menus, it’s possible to initialize menu command items which are not based on command manager by using the CExtPopupMenuWnd::ItemInsertCommand() API instead of the CExtPopupMenuWnd::ItemInsert () API or by specifying true in the bNoRefToCmdMngr parameter of the CExtPopupMenuWnd::LoadMenu() and CExtPopupMenuWnd::UpdateFromMenu() APIs. In case of customizable toolbars and menus you can specify unique toolbar/menu texts using the CExtCustomizeCmdTreeNode::SetTextInToolbar() and CExtCustomizeCmdTreeNode::SetTextInMenu() APIs.
|
|
Robert Webb
|
Oct 21, 2008 - 10:56 PM
|
Thanks for the tip, however I’m a bit lost. The menus in question are created on the fly (in code, not from a resource) using plain old CMenu and AppendMenu() to add items. Somewhere down the track I guess Prof-UIS gets itself involved somehow and changes my menu labels (if their IDs are also used elsewhere).
Are menu items subclasses as Prof-UIS classes at some point? What call does that? Is there a way to get the label set with CMenu::AppendMenu() to stick? Or will I need to do something later after Prof-UIS has done its thing to turn them back? Also, I have a similar problem with buttons on the ribbon bar. Same command ID, but should show a different icon in different places. If worse comes to worst, I can use different IDs, but I’m curious about whether it can be done with the same IDs (and using different IDs won’t be so easy for me with the menu problem).
Thanks,
Rob.
|
|
Robert Webb
|
Oct 28, 2008 - 7:07 PM
|
Hi,
Still waiting for feedback on this.
Currently we create a menu using CMenu::CreateMenu() & CMenu::CreatePopupMenu(), and add items using CMenu::AppendMenu(). We then attach the menu to a toolbar button using CExtToolControlBar::SetButtonMenu(buttonIndex, menu.Detach()).
So we don’t use Prof-UIS calls to create the menu, but the command manager still manages to change their labels, so I presume somewhere down the track Prof-UIS subclasses my menus from Prof-UIS classes. Is this the case? If so, what call does this?
It looks like maybe I can create the menu using Prof-UIS calls instead by creating a CExtPopupMenuWnd, then using ItemInsert() or ItemInsertCommand() to populate it. Then how do I access an item after creating it in order to call CExtCustomizeCmdTreeNode::SetTextInMenu() as you suggest? And how do I put the whole menu on a toolbar button? SetButtonMenu() requires a HMENU.
Thanks,
Rob.
|
|
Technical Support
|
Oct 30, 2008 - 4:26 AM
|
We are sorry for the delay with this reply. By default all the menu command items are based on CExtCmdItem command descriptions stored in a CExtCmdProfile command profile inside the CExtCmdManager command manager (the g_CmdManager global smart pointer variable). The CExtCmdItem object contains all the text properties of a command. The CExtCmdProfile command profile also contains the CExtCmdIcon icon objects which can be optionally assigned to commands. You are constructing menus dynamically. This approach is OK. But please ensure the dynamically constructed menu commands have command identifiers which are not intersected with statically defined menu commands in the menu resources of your projects. Prof-UIS uses the 29000 . . . 31000 range of identifiers for everything including menu commands, toolbar commands and any resource identifiers. It’s also not recommended to intersect with this range.
It’s also possible to use you dynamically constructed menus without changing dynamically generated identifiers of menu commands. The CExtPopupMenuWnd popup menu also supports menu command items which are not based on the command manager. Such menu command items should be inserted into popup menu using the CExtPopupMenuWnd::ItemInsertCommand() method (instead of the CExtPopupMenuWnd::ItemInsert() method) or using the false value in the bNoRefToCmdMngr parameter of the CExtPopupMenuWnd::LoadMenu() and CExtPopupMenuWnd::UpdateFromMenu() methods.
|
|
Robert Webb
|
Oct 30, 2008 - 5:48 PM
|
Hmm, this is restating what you previously said and not answering my questions.
What we want to do: dynamically create a menu which will appear as a drop-down from a toolbar button, and allow it to use the same ID as items in the main menu and same icon, but with different text.
Currently we use native MFC: CMenu::CreateMenu(), CMenu::CreatePopupMenu(), and CMenu::AppendMenu(). Is it correct that there’s no way to stop Prof-UIS from replacing their text if their IDs match other controls?
If that’s the case we need to create them using Prof-UIS commands. ItemInsertCommand() is probably not for us, since we would still like some attachment to the command manager (eg inherit icon defined for other control). So your alternative suggestion was to use SetTextInMenu(). For this we need a pointer to a menu item as a CExtCustomizeCmdTreeNode. So one of my previous questions was how to do this.
It looks like maybe we can call the undocumented CExtPopupMenuWnd::_CmdNodeGet() to get the root node and its children may hopefully be the menu items?
Next puzzle however is how to attach the CExtPopupMenuWnd as a drop-down for a toolbar button. For that we need to call SetButtonMenu(), but that takes an HMENU as an argument, which brings me back to my other previous question. Is there an underlying HMENU we can access from a CExtPopupMenuWnd? I notice the ExportToMenu() method, but I presume this re-creates the whole menu rather than giving access to the existing one. So how do we attach a CExtPopupMenuWnd menu as a drop-down for a toolbar button?
Thanks,
Rob.
|
|
Robert Webb
|
Oct 20, 2008 - 8:38 PM
|
There are a few annoying traits Prof-UIS has that I don’t see in BCG or CodeJock, and I’d love to see Prof-UIS catch up in this regard. These observations come from just looking at the Office 2007 demos from each vendor (I used the Office 2007 R3 Obsidian style for each).
(1) When the window loses focus, the title bar doesn’t get redrawn, and so stays in the active colour. Dragging another window over it and away again redraws the part that was covered to show the grey inactive colour, while the rest remains in the active colour. See top left of image below:
(2) Often if the window doesn’t have focus and I clicked and drag the title bar up or down, it won’t move. It flashes briefly as the window gets focus (momentarily redrawing in the inactive colour, as it should have when it first lost focus, then redrawing in the active colour), but the window stays where it is. If you click and hold for a moment before dragging then it will drag with the mouse, but it won’t catch on if you drag straight away at even quite a slow speed.
(3) More gradual rearranging of controls on the ribbon bar when resizing would be nice. Eg the Arrange group under the Page Layout tab. It has 7 buttons on it. When there’s enough room the are all large, and when it shrinks the last 6 become 2 columns of 3 smaller buttons. Why is there not an intermediate stage with 4 large buttons and 3 small? Both BCG and CodeJock demos do this. Our project has lots of buttons in some groups, and it becomes quite significant. I think it may be possible to work around this by inserting an extra level in the ribbon tree to group buttons together (but haven’t tried yet), however my point is that there’s no reason this shouldn’t be automatic as it is from the other vendors.
(4) Biggest problem is a known issue, just that the ribbon bar under Office 2007 styles is very slow. Slow to rearrange and resize, and very slow to keep up with which buttons should be highlighted as the mouse moves over them. Try these things in BCG or CodeJock and it’s more or less instant. Quickly move the mouse left and right over a Prof-UIS ribbon bar and you’re lucky to get a change in highlighting more than once a second.
(5) I’ve also seen weird stuff when resizing.
(5A) Often it will continue resizing past where the mouse was when you released the button (if you are still moving the mouse, which often I am as I know where I want the mouse next). It’s as if somewhere it is polling the mouse rather than just using events, and thus actions can get out of order.
(5B) Other times the border lags behind the mouse position while dragging, for example if I drag quickly than hold still (button still down), the border may resize towards the mouse but not all the way, and stay that way until I move the mouse slightly again at which point it snaps across. The latter isn’t apparent in the sample, but is in our project, especially in debug build, and may be more likely to appear when there are lots of docked toolbars too. But debug or not, I can’t see how a purely event-based app could produce this result.
(5C) A less common but more troublesome occurrence is that sometimes even after you release the mouse button, it will continue to be somewhat attached to it. After this, moving the mouse outside the window is fine, but when moving it back across the border that was previously being resized, it re-attaches and drags that border further. You have to click elsewhere to get things back to normal. Again, I can’t see this one happen in the sample, but it occurs in our project.
(6) Buttons with colour indicators under their icons are not available as with the other packages.
On the plus side, Prof-UIS does seem quite powerful compared to the others. For example, MDI tabs can be docked vertically unlike BCG. I guess they each have their own pros and cons, but I see the above list as the main things dragging Prof-UIS back at this time. I hope some of these things are already planned for 2.8.4?
Thanks,
Rob.
|
|
Offer Har
|
Oct 20, 2008 - 11:51 AM
|
When the user choose an option from the drop list, I need to open a dialog - the problem is that teh drop list is not closed yet. How do force close it? Thanks, Ron.
|
|
Technical Support
|
Oct 25, 2008 - 8:43 AM
|
Try the following code before showing your dialog box: if( CExtPopupMenuWnd::IsMenuTracking() )
CExtPopupMenuWnd::CancelMenuTracking();
CWnd::CancelToolTips();
|
|
Offer Har
|
Oct 20, 2008 - 11:44 AM
|
|
|
Offer Har
|
Oct 27, 2008 - 2:55 PM
|
Well... is there a way to do it?
|
|
tera tera
|
Oct 22, 2008 - 3:04 AM
|
I do following how to use.
Is there a problem? I wait for an answer from a support team.
typedef int (__cdecl * SortCellComboBox_CallBack )( const void * , const void * );
int Fn_SortNumAscending( const void * arg1 , const void * arg2)
{
CExtGridCellComboBox::ITEM_INFO * pData1 = *(CExtGridCellComboBox::ITEM_INFO**)arg1;
CExtGridCellComboBox::ITEM_INFO * pData2 = *(CExtGridCellComboBox::ITEM_INFO**)arg2; double dWk1 = atof(pData1->m_sString);
double dWk2 = atof(pData2->m_sString); if ( dWk1 != dWk2 ){
if ( dWk1 > dWk2 ){
return 1;
}else{
return -1;
}
}
return 0;
}
void CXGridCellComboBox::Sort( SortCellComboBox_CallBack Fn_Sort )
{
qsort(
m_arrItems.GetData() ,
m_arrItems.GetSize() ,
sizeof(m_arrItems[0]) ,
Fn_Sort
);
}
|
|
Offer Har
|
Oct 20, 2008 - 5:21 AM
|
Hi, I have a combo-box that contains a list of sorted string, just like a normal combo, but after these strings I need to place a separation line, and the item ’Other...’ that needs to open a dialog box for chose other values. Is there any way to do this in Prof-UIS? Thanks, Ron.
|
|
Technical Support
|
Oct 25, 2008 - 8:42 AM
|
Each item in the combo box cell stores a user-defined value. You can specify it when adding new items with InsertString or AddString</code> methods or change it at runtime with the SetItemData method.
Then you should override the CExtGridCellComboBox::OnPopupListBoxSelEndOK virtual method and check if the user defined-value associated with selected item is equal to the value you assigned to the ‘Other..’ item. If yes, then show your dialog box.
|
|
Offer Har
|
Oct 25, 2008 - 8:47 AM
|
This is clear - my question is if & how to add a line to separate this item from the rest of the items. And, if you’ll answer teh question on how to sort a combo cell, how to make sure this item will be last.
|
|
tera tera
|
Oct 19, 2008 - 8:49 PM
|
Hello. In Japanese edition Excel2007, I do hover of a button.
However, a status message is not displayed.
In MicroSoft-Ribbon and Prof-UIS-Ribbon, why are specifications different? Give me an answer if not busy.
|
|
Technical Support
|
Oct 21, 2008 - 12:59 PM
|
The CExtRibbonButtonFile class implements the round file button for ribbon bar. It uses the __EXT_MFC_ID_RIBBON_APPLICATION_BUTTON dialog control identifier which is defined as follows: #define __EXT_MFC_ID_RIBBON_APPLICATION_BUTTON 1 We suspect this identifier is somehow intersected with other identifiers in your project. Please try and change the identifier of the ribbon file button.
|