Subject |
Author |
Date |
|
Krustys Donuts
|
Jul 18, 2008 - 7:47 PM
|
Dear Support, I have a PNG image I would like to use in a CExtButton class. I am having trouble loading the image. I have used the MS Visual Studio resource editor to import the PNG image. The loading code is below: // Load PNG from resources: CExtSkinBitmap _bmpTmp; LPCTSTR strPngImageResourceID = MAKEINTRESOURCE( IDB_pngJogCcw ); LPCTSTR strPngResourceSection = _T("PNG"); HINSTANCE hInst = ::AfxFindResourceHandle( strPngImageResourceID, strPngResourceSection ); ASSERT( hInst ); HRSRC hRsrc = g_ResourceManager->FindResourceHandle( hInst, strPngImageResourceID, strPngResourceSection ); ASSERT( hRsrc ); VERIFY( _bmpTmp.LoadPNG_Resource( hInst, hRsrc ) ); Resource file: ///////////////////////////////////////////////////////////////////////////// // // PNG // IDB_pngJogCcw PNG "res\\test_arrow_button.png" I get a compile error:
1>c:\source\studio 2008\plugins\ziggy\vrtabchildjointspace.cpp(99) : error C2664: ’CExtResourceManager::FindResourceHandle’ : cannot convert parameter 1 from ’HINSTANCE’ to ’__EXT_MFC_SAFE_LPCTSTR’);
From your documentation, once I load the png image I can then load it into a CExtButton object using the SetIcon routine. Is this true?
Thanks,
Gil
|
|
Technical Support
|
Jul 19, 2008 - 11:46 AM
|
You are invoking the CExtResourceManager::FindResourceHandle() method with incorrect parameters. Here is declaration of this method:HINSTANCE FindResourceHandle(
__EXT_MFC_SAFE_LPCTSTR strResourceType,
UINT nResourceName,
WORD * p_wLangIdOut = NULL,
HRSRC * p_hResourceOut = NULL
)
This is how you are invoking it:
HINSTANCE hInst = ::AfxFindResourceHandle( strPngImageResourceID, strPngResourceSection );
ASSERT( hInst );
hRsrc = g_ResourceManager->FindResourceHandle( hInst, strPngImageResourceID, strPngResourceSection );
This is how it should be invoked:
HRSRC hRsrc = NULL;
HINSTANCE hInst = g_ResourceManager->FindResourceHandle( strPngResourceSection, IDB_pngJogCcw, NULL, &hRsrc );
ASSERT( hInst != NULL );
ASSERT( hRsrc != NULL);
So, invocation of AfxFindResourceHandle() API is not needed at all. By default, the the CExtResourceManager::FindResourceHandle() method does the same as the AfxFindResourceHandle() API. But it’s possible to configure the Prof-UIS resource manager for searching resources in several DLL/EXE modules before starting default search algorithm similar to that implemented in the AfxFindResourceHandle() API. Please note, you can insert resource copies for several languages, including PNG resources, and then make your application searching resources of some preferred by user language. This can be done using the CExtResourceManager::FindResourceHandleEx() method which allows to specify desired language identifier for searching.
|
|
Chun Pong Lau
|
Jul 18, 2008 - 1:06 PM
|
Dear support team, In a ribbonbar application, there is a big button in the leftmost-topmost corner position. This is a very nice feature. How can I detect its mouse up event and call my own function? Thanks a lot. Chun Pong
|
|
Technical Support
|
Jul 19, 2008 - 11:30 AM
|
This big button in instance of the CExtRibbonButtonFile toolbar button. It’s instantiated in the CExtRibbonBar::Ribbon_FileButtonInit() virtual method. You should override this virtual method and return instance of your CExtRibbonButtonFile -derived class. Your button class should implement the CExtBarButton::OnClick() virtual method for handling mouse click events. Please do not forget to invoke method of parent button class.
|
|
Chun Pong Lau
|
Jul 19, 2008 - 2:42 PM
|
Yes. It works. Thank you for your answer.
|
|
howard liu
|
Jul 18, 2008 - 8:58 AM
|
Hi, Some of the Buttons in dialog boxes and message boxes does not appear (invisible) after applying prof-ui in VISTA os. These buttons appear normal after Prof-ui in XP and MAC. Is there any specific reason Thanks Howard
|
|
Technical Support
|
Jul 18, 2008 - 10:27 AM
|
Please provide us with information about how to reproduce this issue using any of our sample application with dialogs? We need to run some application on both Windows XP and Windows Vista and detect some hidden buttons on Windows Vista. This will allow us to debug this issue if it really exist.
|
|
howard liu
|
Jul 18, 2008 - 8:55 AM
|
Hi, Is there an equivalent control in Prof-UI and its related resource for "picture control" in mfc Thanks, Howard
|
|
howard liu
|
Jul 29, 2008 - 5:01 AM
|
Hi,
I have a picture control inside a dialog and picture control is customized to display some text.problem is when i skin dialog the picture control also gets completely coloured and i am not able to see the text inside it.So plz tell me how to overcome it.
Thanks,
|
|
Technical Support
|
Jul 31, 2008 - 4:05 AM
|
The first thing you should pay attention to is group boxes. If you have the group boxes on you dialog check the tab order. The group boxes should have the greater order numbers than the controls inside it. You can learn more about this issue from this article.
Then check how your custom text is painted over picture control. The dialog overwrites painting the dialog background so if you have own painting code in the dialogās OnPaint method you should change it. Just note if you are using the OnPaint() message handler in your dialog the CClientDC class should be used instead of CPaintDC , because the themed background is painted before the OnPaint() handler is called: void CMainDlg::OnPaint()
{
CClientDC dc(this);
dc.LineTo( 100, 100 );
} If you still have the problems you can send us your dialog class code or entire project so we can find out whatās wrong ourselves.
|
|
Technical Support
|
Jul 18, 2008 - 10:23 AM
|
You should use CExtLabel class. It supports painting of CExtBitmap images including 32-bit format with alpha channel on any Windows OS. It can optionally tile, stretch or center image.
|
|
Wang Hui Qing
|
Jul 18, 2008 - 2:57 AM
|
Dear Tech Support, Our project is ANSI, in the main program project (e.g. Main_Program) it will be automatically linked with profuis283n.lib. However, for one of the dll (e.g. Config.dll) which is used by main program, one of the Config projects file includes stdafx.h from Main_Program. When we build Config.dll, it shows "automatically linking profuis283m.lib". Character Set in vs2005 project property is "Not Set"for both Main_Program and Config. When I run Main_Program, only profuis283n.dll will be loaded. However, to get project cobuild success, you must include both profuis283m.lib and profuis283n.lib. Although I don’t see any problem for the moment, but it make me wondering how this automatic linking works for Prof-UIS.
|
|
Technical Support
|
Jul 18, 2008 - 6:58 AM
|
Automatic linking feature is provided by Visual C++ compiler and linker. This is not the feature of Prof-UIS/MFC. Prof-UIS header files simply use appropriate #pragma directives. These directives inform Visual C++ about additional LIB files to link with your compiled modules (EXE or DLL) when Prof-UIS.h file is included into your project.
One StdAfx.h file can be theoretically used by more than one project. But we do not recommend you to do this because you will have difficulties with relative includes. Besides, different project are typically always require different sets of include files.
Modern software is Unicode - not ANSI and not MBCS. Successful software is very international and, of course, Unicode. Modern Windows OS versions are Unicode. Most of modern software will not run at all or run with problems on Windows 95 / 98 / ME which are not Unicode systems. You can use ANSI for developing for some embedded or mobile platforms, simple phones, portable game devices etc. We do not see any reasons to use ANSI in Windows OS related development.
|
|
Chun Pong Lau
|
Jul 18, 2008 - 2:26 AM
|
Dear support team,
This question is not really related to PROF-UIS. Just see if you can give us an easy answer.
Z-order in windows application determines the order of window arranged vertically on desktop.
The question is how to find out the z-order of a specific window (CWnd)?
Thanks a lot.
Regards, Chun Pong
|
|
Chun Pong Lau
|
Jul 18, 2008 - 1:02 PM
|
Thank you for your kind response. It really helps.
|
|
Technical Support
|
Jul 18, 2008 - 6:42 AM
|
All the windows on the desktop are organized into tree layout. This is related both for popup and child window. If you have some HWND window handle or CWnd* pointer, then you can start navigate window tree:
1) You can get parent window using ::GetParent() Win32 API or CWnd::GetParent() method.
2) You can get first sibling window (first window on the same level) using ::GetNextWindow() Win32 API or CWnd::GetNextWindow() method with GW_HWNDFIRST parameter. For example, first sibling window for OK button in some dialog is the first dialog control.
3) You can get last sibling window (last window on the same level) using ::GetNextWindow() Win32 API or CWnd::GetNextWindow() method with GW_HWNDLAST parameter.
4) You can get previous sibling window (previous window on the same level) using ::GetNextWindow() Win32 API or CWnd::GetNextWindow() method with GW_HWNDPREV parameter.
5) You can get next sibling window (next window on the same level) using ::GetNextWindow() Win32 API or CWnd::GetNextWindow() method with GW_HWNDNEXT parameter.
6) You can get first child window using ::GetNextWindow() Win32 API or CWnd::GetNextWindow() method with GW_CHILD parameter.
7) You can last first child window using two invocations of the ::GetNextWindow() Win32 API or CWnd::GetNextWindow() method: first invocation with GW_CHILD parameter will return first child window and second invocation with GW_HWNDLAST parameter will return last sibling window of first child window.
As you can see, the children windows of each window are organized into linked list (similar to CList in MFC or std::list in STL). So, It’s not possible to get child window by its index. You should walk through list of child windows instead.
Of course windows ca be created and destroyed anytime at run-time. If you need to save reference to some window, then please save its HWND window handle and not use CWnd* pointers because these pointers can be temporarily. You can use the ::IsWindow() Win32 API for detecting whether the specified HWND handle is valid window handle. The CWnd::FromHandlePermanent() and CWnd::FromHandle() methods (see MSDN for details) should be used for conversion from HWND window handle into CWnd* pointer.
|
|
Chun Pong Lau
|
Jul 18, 2008 - 2:26 AM
|
Dear support team,
This question is not really related to PROF-UIS. Just see if you can give us an easy answer.
Z-order in windows application determines the order of window arranged vertically on desktop.
The question is how to find out the z-order of a specific window (CWnd)?
Thanks a lot. Regards, Alan
|
|
Chun Pong Lau
|
Jul 18, 2008 - 2:27 AM
|
Sorry, it is duplicated. Please ignore or delete this.
|
|
howard liu
|
Jul 17, 2008 - 11:08 PM
|
Hi, Using CExtResizable property sheet makes the property pages to go out of boundary in some cases when used in our customized classes due to which the tab headers are not visible ( the tab headers get superimposed and when we pull the property page we get to see the tab headers). Is there a way to handle this scenarion Thanks, Howard
|
|
Fransiscus Herry
|
Sep 5, 2010 - 2:23 PM
|
Dear Support, Would you be able to provide a simple sample according to your instruction above. I also need this kind of property dialog box. I am looking forward to hearing from you soon
|
|
Fransiscus Herry
|
Sep 5, 2010 - 2:26 PM
|
And also, would you be able to create links about all your small sample project that you have created on this forum for both general and support forum. I think this will be so helpful for people to learn your code in a simple way. I like the sample on your website but,it took sometimes to figure it out what i want. thank you.
|
|
Technical Support
|
Sep 6, 2010 - 6:12 AM
|
You can see tab page containers with dialog pages in the Tab Containers dialog page of the ProfUIS_Controls sample application. The same can be created using a simpler dialog window layout. I.e. One modal dialog window with CExtTabPageContainerWnd and OK, Cancel, Help buttons. Several dialog or other windows should be created as children of the CExtTabPageContainerWnd window. This simple window layout emulates a classic resizable property sheet in tabbed mode. But you can use CExtResizablePropertySheet and CExtResizablePropertyPage controls of Prof-UIS 2.90 as is because they also support a themed tab control.
|
|
Technical Support
|
Jul 18, 2008 - 6:20 AM
|
Current versions of the CExtResizablePropertySheet and CExtResizablePropertyPage classes are designed for property sheets in the Wizard mode (i.e. without visible tab common control). If you need tabbed property sheets, then please use the following UI design:
1) Create popup dialog (resource and C++ class) with CExtTabPageContainerWnd control, OK, Cancel and other needed buttons. Tab page container can be either created in OnInitDialog() method or inserted as custom control into dialog template resource. You can find tab page containers as custom controls in the ProfUIS_Controls sample application.
2) Create several child dialogs (resources and C++ classes) implementing pages. These dialogs should have both Child and Visible properties of dialog template resource set on.
3) Initialize dialog pages in the OnInitDialog() virtual method of popup dialog. Dialog pages should be created as children windows of the CExtTabPageContainerWnd window. Then you should register them as pages with invocation of the CExtTabPageContainerWnd::PageInsert() method.
|
|
Offer Har
|
Jul 17, 2008 - 1:55 PM
|
As we asked before, is there a way to get a better support, we are willing to pay for it... All we want is that sombody will read our mails, confirm bugs, and fix them... not too much.
|
|
Technical Support
|
Jul 17, 2008 - 2:28 PM
|
Please do not be angry with us. We are overloaded with e-mails and scheduled web conferences. We have much more e-mails than messages in forums at this site. We are working with your issue reports. They are simply not ready yet.
|
|
Offer Har
|
Jul 18, 2008 - 11:04 AM
|
Can you please give some estimations? There are issues that we wait for answers for months.
|
|
Chun Pong Lau
|
Jul 17, 2008 - 6:04 AM
|
Dear support team,
How do I change the caption text of a dynamic control bar after initialization by program?
Thanks a lot, Chun Pong
|
|
Chun Pong Lau
|
Jul 17, 2008 - 7:12 AM
|
I’ve solved this one myself.
CWnd *pWnd = AfxGetMainWnd(); pWnd->SetWindowText(sNewCaption); pWnd->SendMessage( WM_NCPAINT ); pWnd->Invalidate(1); pWnd->UpdateWindow();
|
|
Technical Support
|
Jul 17, 2008 - 1:14 PM
|
Please also note the following: the CExtControlBar::OnGetBarCaptionText() virtual method in invoked by Prof-UIS framework for querying different bar captions: single bar caption, floating mini frame caption, tabbed group caption, tab item caption. Default implementation of this method returns control bar’s window text in case of any caption. But you can provide control bar with different captions via overriding the the CExtControlBar::OnGetBarCaptionText() virtual method.
|
|
Chun Pong Lau
|
Jul 17, 2008 - 5:54 AM
|
Dear support team, There is a down arrow button in the caption of the control bar. How do I remove it? Thanks a lot. Regards, Chun Pong
|
|
Technical Support
|
Jul 17, 2008 - 1:09 PM
|
The CExtControlBar::OnNcAreaButtonsReinitialize() virtual method initializes caption buttons. Each button is instance of the CExtBarNcAreaButton -based class. You should override this virtual method in your CExtControlBar -derived class, copy source code from the original method and comment instantiation of the CExtBarNcAreaButtonMenu class.
|
|
Chun Pong Lau
|
Jul 17, 2008 - 5:53 AM
|
Dear support team, When I dock 2 control bars inside a tabbed container by dragging to the center of docking marker, How do I show up each one by program? Thanks a lot. Regards, Chun Pong
|
|
Chun Pong Lau
|
Jul 18, 2008 - 12:20 AM
|
According to a previous thread here (Controlling Docking Programatically ), I’ve written this function and it works now.
void CMainFrame::SelectDynTab(CExtControlBar* pBar2Select){ CWnd * pWndParent = pBar2Select>GetParent(); if (pWndParent->IsKindOf( RUNTIME_CLASS( CExtDockDynTabBar ) ) ){ // pBar2Select is inside a tabbed bar container CExtDynTabControlBar * pTabbedBar = STATIC_DOWNCAST( CExtDynTabControlBar, pWndParent->GetParent() ); if (pTabbedBar){ LONG nCurrSel = pTabbedBar->GetSwitcherSelection(); LONG nBarIndex, nBarCount = pTabbedBar->GetSwitcherItemCount(); for( nBarIndex = 0; nBarIndex < nBarCount; nBarIndex ++ ){ CExtControlBar* pBar = pTabbedBar->GetBarAt( nBarIndex, false ); if (pBar == pBar2Select && nCurrSel != nBarIndex){ pTabbedBar->SetSwitcherSelection( nBarIndex, true, true ); break; } } } } }
|
|
Technical Support
|
Jul 17, 2008 - 1:00 PM
|
You should use CFrameWnd::ShowControlBar() method for each of your control bars. This method allows you to show several controlbars with delay. The CFrameWnd::RecalcLayout() method will apply delayed control bar layout and visibility changes.
|
|
Chun Pong Lau
|
Jul 17, 2008 - 1:55 PM
|
No. It doesn’t work.
Let me describe more clearly. I don’t mean normal show/hide of a control bar. I am talking about selecting a control bar TABBED into a parent control bar.
The following image show the tabbed control bar I described: http://www.prof-uis.com/img/tour_img/Visual_Studio_2008_Docking_Markers_Windows_XP_tab.png the left highlight shadow is the tabbed control bar i am talking about. (by releasing upon the center of the docking marker)
What I wanted to do is to select the above tab by program. e.g. there are tab A, B, C, D, which are all tabbed together. Suppose tab A is in use. I would like to select another tab, say, B, by program.
Thanks a lot.
|
|
Technical Support
|
Jul 17, 2008 - 2:25 PM
|
You need to know the following information which will allow you to dock resizable control bars into any layout:
1) Some of bars in your application should be docked initally to some sides of the main frame window using the CExtControlBar::DockControlBarInnerOuter() method. This method will dock resizable control bar into specified side of the main frame window and bar will allocate entire row or column closer to frame center or frame border (depending on parameters).
2) Some of bars will be initially switched into floating state using the CExtControlBar::FloatControlBar() method.
3) If you want to dock resizable control bar relatively to other already docked or floating bar, then you should invoke the CExtControlBar::DockControlBarLTRB() method (actually 2 overloaded methods with this name). This method does the same as left/right/top/bottom docking markers (which also known as guide diamonds).
4) If you want to dock resizable control bar into one tabbed group with other bar, then you should invoke the CExtControlBar::DockControlBarIntoTabbedContainer() method. The other bar can be either standing alone or already part of some tabbed group. This method does the same as central docking marker.
5) Invocation of the CExtControlBar::AutoHideModeSet() method will switch bar into auto-hidden mode. If bar is part of tabbed group, then all the bars in this tabbed group will become auto-hidden. Floating bars can not become auto-hidden.
6) Sending the WM_COMMAND message to main frame window and specifying dialog control identifier of resizable control bar window in the WPARAM parameter will activate/show bar and set focus to bar’s child window. This is true for resizable control bars in any state: docked, floating, auto hidden.
7) You can invoke CExtControlBar::SetInitDesiredSizeHorizontal() or CExtControlBar::SetInitDesiredSizeVertical() method for specifying desired height (at top/bottom side of main frame) or desired width (at left/right side of main frame) of resizable control bar before invoking its CExtControlBar::DockControlBarInnerOuter() method. You can invoke CExtControlBar::SetInitDesiredSizeFloating() and CExtControlBar::SetInitDesiredPosFloating() methods for specifying desired floating location of resizable control bar before invoking its CExtControlBar::SetInitDesiredPosFloating() method.
We guess item 4 is the most interesting for you, but we believe entire list will help in you in your project(s) development.
|
|
Chun Pong Lau
|
Jul 17, 2008 - 10:47 PM
|
Dear support team,
I’m sorry to tell you that you MISUNDERSTOOD my question, which is NOT related to how to dock control bars. It’s about how to SELECT a tabbed control bar. Let’s me rephrase it.
Support there are two resizable control bars, BAR A & BAR B, they are both docked into another resizable control bars (a tabbed container), BAR C by DockControlBarIntoTabbedContainer().
Thus, all BAR A, B & C are tabbed together and suppose BAR A is activated and showing. BAR B & C are hidden.
If I want to select and activate BAR B by mouse, I can just simply click the tab below BAR B. Then BAR B will show up and BAR A & C will be hidden.
What I want to do now is to select the BAR B tab by program.
Do you understand my question? Thanks.
Chun Pong
|
|
Chun Pong Lau
|
Jul 17, 2008 - 10:47 PM
|
Dear support team,
I’m sorry to tell you that you MISUNDERSTOOD my question, which is NOT related to how to dock control bars. It’s about how to SELECT a tabbed control bar. Let’s me rephrase it.
Support there are two resizable control bars, BAR A & BAR B, they are both docked into another resizable control bars (a tabbed container), BAR C by DockControlBarIntoTabbedContainer().
Thus, all BAR A, B & C are tabbed together and suppose BAR A is activated and showing. BAR B & C are hidden.
If I want to select and activate BAR B by mouse, I can just simply click the tab below BAR B. Then BAR B will show up and BAR A & C will be hidden.
What I want to do now is to select the BAR B tab by program.
Do you understand my question? Thanks.
Chun Pong
|
|
Chun Pong Lau
|
Jul 17, 2008 - 10:59 PM
|
Dear support team, Below is the diagram representing the situation. -------------------
| |
| |
| |
| |
| ______ |
|_A_|_B_|_C_| Where BAR A is activated. The question is now "How can I activate BAR B by program? Regards, Chun Pong
|
|
Technical Support
|
Jul 18, 2008 - 7:06 AM
|
Our last answer in this thread already contains details about how to select and activate bar B: you should send the WM_COMMAND message to main frame window and specify dialog control identifier of bar B in WPARAM parameter:CFameWnd * pMainFrame = . . .
CExtControlBar * pBarB = . . .
pMainFrame->SendMessage( WM_COMMAND, WPARAM( pBarB->GetDlgCtrlID() ) );
|
|
Chun Pong Lau
|
Jul 19, 2008 - 11:03 AM
|
Sorry sirs, the above method isn’t working but this one. Please correct me if I am wrong. void CMainFrame::SelectDynTab(CExtControlBar* pBar2Select){
CWnd * pWndParent = pBar2Select->GetParent();
if (pWndParent->IsKindOf( RUNTIME_CLASS( CExtDockDynTabBar ) ) ){
// pBar2Select is inside a tabbed bar container
CExtDynTabControlBar * pTabbedBar = STATIC_DOWNCAST( CExtDynTabControlBar, pWndParent->GetParent() );
if (pTabbedBar){
LONG nCurrSel = pTabbedBar->GetSwitcherSelection();
LONG nBarIndex, nBarCount = pTabbedBar->GetSwitcherItemCount();
for( nBarIndex = 0; nBarIndex < nBarCount; nBarIndex ++ ){
CExtControlBar* pBar = pTabbedBar->GetBarAt( nBarIndex, false );
if (pBar == pBar2Select && nCurrSel != nBarIndex){
pTabbedBar->SetSwitcherSelection( nBarIndex, true, true );
break;
}
}
}
}
}
|
|
Technical Support
|
Jul 19, 2008 - 11:24 AM
|
The method is correct. But you can use the CExtControlBar::_GetNearestTabbedContainer() which returns pointer to tab container bar or NULL if the bar is not in the tabbed group:
CExtControlBar * pBar = . . .
CExtDynTabControlBar * pTabbedBar = pBar->_GetNearestTabbedContainer();
if( pTabbedBar != NULL )
{
. . .
}
You can also use the CExtDynTabControlBar::FindControlBar() method to get index of child bar inserted into group:
LONG nChildBarIndex = pTabbedBar->FindControlBar( pBar );
if( nChildBarIndex >= 0 )
{
. . .
}
Returned zero-based index value can be negative if specified bar is not found in the tabbed group.
|
|
Ian McIntosh
|
Jul 17, 2008 - 3:09 AM
|
Hi, I have an empty menu that I populate within OnExtMenuPrepare using
pPopup->ItemInsert(ID_MYID);
but how can I make this appear with a tick against it ?
|
|
Ian McIntosh
|
Jul 18, 2008 - 3:07 AM
|
Hi, I do NOT want to add a separator - I want to show a tick against a menu item! For example, when I right click to get a list of control bars, the open ones are listed with a tick against then. That’s what I want to do. Currently, if I use SetCheck() in the OnUpdateMyid() function, i get an orange border around the icon. This isn’t obvious enough - and particluarly the difference between checked and undefined (3rd state). So I want to show a tick instead.
|
|
Technical Support
|
Jul 18, 2008 - 8:02 AM
|
The command descriptions (CExtCmdItem ) stored in the command manager (g_CmdManager ) can have attached icon objects (CExtCmdIcon ) and can be icon-less. By default, popup menu (CExtPopupMenuWnd ) gets all the information about menu command items from the command manager. If the checked/radio-checked command contains icon, then menu command item draws icon with highlighted background. If command has no icon, then menu draws check-mark/radio-mark for menu command item. So, you should simply use commands without icons. The icon object are typically appear in the command descriptions when the command manager is updated from toolbar resource which contains command button with appropriate identifier.
You can also switch using menu command items which are not based on the command manager and not updated via MFC’s command updating mechanism. To insert such menu commands into your dynamically constructed popup menu you should use the CExtPopupMenuWnd::ItemInsertCommand() method instead of the CExtPopupMenuWnd::ItemInsert() method.
|
|
Technical Support
|
Jul 17, 2008 - 12:58 PM
|
If you need menu separator item, then you should invoke the CExtPopupMenuWnd::ItemInsert() method (or CExtPopupMenuWnd::ItemInsertCommand() ) and specify the ID_SEPARATOR value as command identifier. The ID_SEPARATOR preprocessor variable is defined in MFC and equal to zero.
|
|
tera t
|
Jul 17, 2008 - 2:56 AM
|
Hello. I make CExtContorlBar dynamically.
Is there any problem?
void CTabMultiDlg::OnButton16()
{
static int iStCnt = -1;
iStCnt++;
CMainFrame * pCMainFrame;
pCMainFrame = (CMainFrame*)AfxGetApp()->m_pMainWnd; CMuControlBar *pDynBar;
pDynBar = &pCMainFrame->m_wndDynBar[iStCnt]; UINT uID;
uID = 5051 + iStCnt; if( ! pDynBar->Create(
_T("Optional control bar caption"),
pCMainFrame ,
uID ,
WS_CHILD
|WS_VISIBLE
|CBRS_TOP
|CBRS_GRIPPER
|CBRS_FLYBY
|CBRS_SIZE_DYNAMIC
|CBRS_HIDE_INPLACE
)
)
{
return ;
} pDynBar->EnableDocking( CBRS_ALIGN_ANY );
pDynBar->ShowFloat(
CPoint( 100 + iStCnt*3 , 100),
CSize ( 100 , 100)
); }
BOOL CMainFrame::DestroyWindow()
{
//---------------------------
int iRec = 0;
while(1){
if ( m_wndDynBar[iRec].m_hWnd != NULL ){
//m_wndDynBar[iRec].HideBar();
m_wndDynBar[iRec].DestroyWindow( );
}
iRec++;
if ( iRec > 90 ){
break;
}
}
CWinApp * pApp = ::AfxGetApp();
|
|
Technical Support
|
Jul 17, 2008 - 1:34 PM
|
This code will not work. Both MFC and Prof-UIS control bars require special destroying actions because internal data of MFC frame windows contains references to control bars created inside frame window. Please find the source code of the KillBar() function by searching the KillBar text in this forum. This function performs correct de-allocation of control bar.
There is one more problem may appear: the state loading algorithms of both MFC and Prof-UIS control bars require exact matching between control bars created inside frame window and control bar state data.
But there are two very good approaches implemented in Prof-UIS for projects which require dynamically allocated control bars:
1) In case of toolbars: you can use customizable toolbars and menu controlled by the CExtCustomizeSite class and demonstrated in DRAWCLI and StyleEditor sample applications. The customize site implements subsystem which allows to allocate, de-allocate, load and save dynamic toolbars and commands both in toolbars and menus. The very extended version of customize site is implemented in the ProfAuto library and demonstrated in ActiveScripts and SimpleScripts sample applications. The ProfAuto library implements set of wrapper COM objects which also allow to work with dynamically allocated toolbars and commands. These COM object can be used for providing automation based languages (VB Script, Java Script, VB, VBA, VB .NET, C#) with ability to access toolbars, menus and commands implemented in your Prof-UIS/ProfAuto based project. This feature is supported in Word, Excel and many other modern applications.
2) In case of resizeable control bars: you can use dynamic resizable control bars (CExtDynamicControlBar ) controlled by dynamic bar site (CExtDynamicBarSite ) instead of simple resizable control bars (CExtControlBar ). Dynamic resizable control bars have several additional features: full support for dynamic count of control bars, support for document and persistently floating modes, Window Options menu in control bar’s caption. They demonstrated in the SDI_DynamicBars and MDI_DynamicBars sample applications.
|
|
tera t
|
Jul 18, 2008 - 3:19 AM
|
Hello. Thank you very much.
|
|
Jae-Ho Lee
|
Jul 17, 2008 - 1:06 AM
|
I am using present Prof-UIS 2.83
By the way, VIsual Studio 2005 Configuration for Win32 platforms are not installed if run now Performing Operations program and are not removed.
I want to know reason.
|
|
Technical Support
|
Jul 17, 2008 - 1:37 PM
|
Prof-UIS integration wizard does only the following with your Visual Studio 2005: it can add/remove Prof-UIS library paths into Visual Studio settings and it can add/remove Prof-UIS Application Wizard. Please let us know which problems exactly occur with Visual Studio 2005 and/or Prof-UIS on your computer? What wasn’t installed correctly?
|
|
Kevin Murray
|
Jul 16, 2008 - 10:10 AM
|
Can reproduce this with MDI_DynamicBars sample. Set the visual style to VS2005. This will enable the "docking guide" indicators when dragging a window to dock it. Now then, float two of the dynamic bars. Place one over the center of the main application and set it to "Floating" if it isn’t already. Set the other window to "Dockable". Drag the dockable window towards the center of the application, and the four-way docking guide will appear over the other floating window. As the "dockable" window crosses over the "floating" window, however, the four-way guide disappears. While I understand that the dockable window can’t dock to the floating window, the appearance and disappearance of the four-way guide seems confusing, particularly to users who may well assume they can utilize it to dock the window. If both are set to dockable, the four-way guide switches to allow the windows to dock in the same floating frame, which is fine. It is just this "floating" case that can get really confusing. Bug? Feature enhancement? Not sure, but our testers found it, and I’m just passing it along. :) K.
|
|
howard liu
|
Jul 16, 2008 - 8:00 AM
|
Hi, There are many message boxes in our application. Are there automated classes for coloring all the message boxes in one shot Thanks, Howard
|
|
Technical Support
|
Jul 17, 2008 - 12:51 PM
|
This feature (skinned system dialogs) is not supported by Prof-UIS directly. It’s also not implemented in all known Microsoft’s modern applications. You can try to do this yourself using the following article: http://www.codeproject.com/cpp/ProfUIS_Dialogs.asp
|
|
tera t
|
Jul 16, 2008 - 2:06 AM
|
Hello. I want to change the drawing position of the tool tip.
I stick a dialogue on the status bar
I display the tool tip of the button.
A tool tip is obstructive and cannot push a button.
|
|
Technical Support
|
Aug 24, 2008 - 11:56 AM
|
You can override the CExtButton::OnAdvancedPopupMenuTipWndDisplay virtual method which is invoked to display the tooltip. In this method you can set your own coordinates and invoke the base class.
|
|
tera t
|
Aug 21, 2008 - 6:24 PM
|
Hello. The position where a tool tip is displayed is not good. Is not there any good method?.
|
|
David Skok
|
Jul 15, 2008 - 6:50 AM
|
By overriding IsItemVisible I limit display to minutes and seconds. Is there a way for me to limit the maximum duration that can be set or even better keep the minutes field to a maximum of 2 digits when hours and days are off? This is the best solution for me however another issue with CExtGridCellDuration is that in the case where I exclude hours and minutes it allows 8 digits of entry for minutes. While I prefer the first solution I could deal with this however if a user enters a large number by mistake it is not possible to remove digits through either backspace or Del. It is possible to clear the field by using the arrow key to select seconds then back to minutes then type a new number which clears the minutes field first. This is not obvious to a user and needs some polishing. Please take a look at it. Thanks, Dave
|
|
Technical Support
|
Jul 31, 2008 - 4:09 AM
|
We implemented the functionality you need. Now the duration control can limit the number of seconds that can be entered by user.
Added the following methods to the CExtDurationWnd class: - SetMaxDuration - GetMaxDuration - OnQueryMaxDuration
In your particular case you want to limit the number of minutes by two digits. It means that the maximum duration value will be 99 minutes and 59 seconds. It is equal to 60*99 + 60 = 5999 seconds.
Now just specify this value in the following way: m_wndDuration.SetMaxDuration( 5999 ); This feature will be available in the next release but if you need it immediately just send the corresponding email request to the support.
|
|
David Skok
|
Aug 5, 2008 - 9:19 AM
|
Thanks, this works perfect for CExtDurationWnd. How can I use it with CExtGridCellDuration in a grid? Dave
|
|
Technical Support
|
Aug 6, 2008 - 11:14 AM
|
We added this functionality to the CExtGridCellDuration as you requested:
SetMaxDuration()
GetMaxDuration()
OnQueryMaxDuration
it will be available in the new release or we can provide your with the updated code on your request.
|
|
Robert Webb
|
Jul 14, 2008 - 8:47 PM
|
Hi, I have some questions in trying to understand the ribbon bar sample code. Unfortunately none of this seems to be documented. - CmdKeyTipSet() is used throughout the sample code. Sometimes I can see that it tells the GUI what tip to display after Alt is pushed. But other times the tip never seems to display. Eg "ZC" is given as the key tip for several different nodes. What’s going on here? - I don’t quite follow how the formatting rules work. Is there documentation for this anywhere? Firstly there are effective and visual rules. To me visual means how it looks and effective is how it acts, but formatting is entirely visual isn’t it? Secondly there are rules for small, normal and large, but button icons in the ribbon bar sample seem to only ever adjust between two sizes. Thanks,
Rob.
|
|
Technical Support
|
Jul 15, 2008 - 1:52 PM
|
Ribbon bar supports both tool tip like key tips and classic keyboard accelerators. Keyboard accelerators are specified in accelerator resource table. Key tips and all the other ribbon specific features are specified from code. It’s recommended to design different key tips for all the ribbon buttons displayed at one level. Ribbon buttons from different levels may have equal key tips.
The ribbon button behavior is defined by its Effective Informativeness Level (ILE) and Visual Informativeness Level (ILV).
ILV is simpy 0, 1 and 2 constants which define small, middle and large button layout: #define __EXT_RIBBON_ILV_SIMPLE_SMALL 0
#define __EXT_RIBBON_ILV_SIMPLE_NORMAL 1
#define __EXT_RIBBON_ILV_SIMPLE_LARGE 2
ILE is constant in more wide range: #define __EXT_RIBBON_ILE_MIN 0
#define __EXT_RIBBON_ILE_MAX 10
Each ribbon button has both ILV and ILE as its properties. It also have array of ILE-ILV pair values which define button’s behavior. Initially ribbon button has maximal ILE value. If there is not enough space in the ribbon bar to display buttons, then ILE of each ribbon button becomes smaller and array of ILE-ILV pairs is used to find new button’s ILV. This is how buttons change their visual look (it’s ILV) when ribbon bar become resized.
|