Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
Artur Shingirei
|
Dec 16, 2004 - 11:04 AM
|
Hello
I have a dialog based application. I use the CExtResizableDialog as base class for my CMainDlg class. But I have troubles with reloading Accelerators and Child Dialogs after I will switch language. ToolBars and Menu I updated Ok, but then I calling some modal dialog after I change the language, always loading dialog which language has been set at OnInitDialog() of main dialog.
void CMainDlg::OnInitDialog() { ..... switch(nId)) { case 1033: g_ResourceManager->SetLangIdDesired( 1033 ); break; case 1049: g_ResourceManager->SetLangIdDesired( 1049 ); break; ... } ... } ... void CMainDlg::OnButton() { CMyDlg dlg; dlg.DoModal(); }
How I can reload all resources(Accelerators,String Tables,etc ) for Dialog based application after language switching?
|
|
Technical Support
|
Dec 17, 2004 - 11:17 AM
|
Dear Artur,
If you use methods of the CExtResourceManager class to load resources and the CExtResDlg or CExtResizableDialog classes as the base classes for your dialogs, you should not encounter any problems with loading the resources of a particular language. Of course, if your application keeps in memory some accelerator tables or string data, then you should reload them with the resource manager (i.e. accelerator tables should be destroyed and created again by calling g_ResourceManager->LoadAccelerators ). Please check this in your application. Of course, you may always send us a test project and we will resolve the problem immediately.
|
|
Artur Shingirei
|
Dec 15, 2004 - 4:20 AM
|
Hello, I added string at resource of Your application "LanguageSwitcher"
ID_STRING_TEST at both resource-Russian and English and set for this ID different value at each "String Table"
So I add following code at Your application:
void CChildFormView::OnCustomLanguageSelected() { int nCurSel = m_comboLanguagePreference.GetCurSel();
if( nCurSel >= 0 ) { WORD nLangID = (WORD) m_comboLanguagePreference.GetItemData( nCurSel ); g_ResourceManager->SetLangIdDesired( nLangID ); HBITMAP hBitmap = GetLangBitmap( nLangID ); m_staticActiveLanguage.SetBitmap( hBitmap ); m_staticActiveLanguage.Invalidate(); } // if( nCurSel >= 0 ) ResetLocalizedResources();
// Test CString str; str.LoadString(ID_STRING_TEST); }
When I change current language from Russian to English and and vice versa the str always loaded value from Russian resourse.
Question:
How I can load string from resource depend on current language?
|
|
Technical Support
|
Dec 15, 2004 - 7:35 AM
|
Please replace the following line in your code:str.LoadString(ID_STRING_TEST); withg_ResourceManager->LoadString( str, ID_STRING_TEST ); If you need to load localized resources, use the methods of the resource manager. For the dialogs in your application, you need to use CExtResizableDialog or CExtResDlg as their base classes. And the last but not the least: Do not forget to recreate the dialog to see the changes.
|
|
Artur Shingirei
|
Dec 15, 2004 - 1:20 AM
|
Hello. I have loaded the new version of your product 2.27, and I have remark for you Prof-IUS Help exactly about class /////////////////////////////////////////////////////////////////////////////////// class CExtCustomizeSite Remarks The CExtCustomizeSite class implements customization mechanism for toolbars and menus. The class also serves as an intermediate for drag-n-drop operations during customization. Header ExtCustomizeSite.h /////////////////////////////////////////////////////////////////////////////////// I have not found a file ExtCustomizeSite.h. This class declared at ExtCustomize.h file Perhaps this is your defect or I upload some corrupted version. I also meets this problem of calling some method of this class for example: CExtCustomizeSite::MenuInfoRemove(); VERIFY CExtCustomizeSite::MenuInfoAdd( this, _T("Default"), IDR_MENU1, true
After the compil: a get an error:
: error C2653: ’CExtCustomizeSite’ : is not a class or namespace name
Although I make an include of ExtCustomize.h
|
|
Technical Support
|
Dec 15, 2004 - 6:44 AM
|
There is no change in how Prof-UIS 2.27 is integrated into your application in comparison with version 2.26. We suppose you have correctly included Prof-UIS.h into the StdAfx.h sile. We may guess you just forgot to derive your frame class from CExtCustomizeSite . Please take a closer look at the list of base classes of CMainFrame in one of the following sample applications: - DRAWCLI
- BitmapEditor
- StyleEditor
- LanguageSwitcher
If there is some other cause of the problem, just send us a test project so that we can help you faster or provide us with more details.
|
|
Artur Shingirei
|
Dec 14, 2004 - 1:26 AM
|
I has just been upload new version 2.27 And I meets with problem:
I create toolbar on the dialog and set the transparent color :
g_CmdManager->UpdateFromToolBar(
GetApp()->m_pszRegistryKey, IDR_BAR1, NULL, NULL, false, true, RGB(255,255,255));
When dialog is appeared the transparent color do not set. When I used 2.25 version of Prof-UIS all was OK. Thank You.
|
|
Technical Support
|
Dec 14, 2004 - 6:17 AM
|
We may guess that you update the images (extracted from IDR_BAR1 ) that stored in the command manager twice. Furthermore, if you used the default grey color as transparent instead of white, you would not have encountered this situation. So, let see what’s happened.
In version 2.27, to allow the developers to change language-dependant resources on-the-fly (at runtime), the algorithm responsible for updating images in the command manager has been modified. This feature became possible with a new component called "Resource Manager". Any multilingual application that requires on-the-fly language switching may need the reloading of toolbar images. So, now all images are forcedly updated each time when you update the command manager with data from a toolbar.
First time your application puts the toolbar commands to the command manager when it invokes g_CmdManager->UpdateFromToolBar . After this step, the images in the command manager are valid and based on the white color as transparent as you specified. The second time, when CExtToolControlBar::LoadToolBar method is called, the command manager is updated with the same commands. At this step, the images are completely replaced. But this method uses the default grey color as transparent. It is not difficult to improve your code. Please use the following code snippet:LPUINT pArrButtonsIDs = NULL;
INT nButtonCount = 0;
VERIFY(
g_CmdManager->UpdateFromToolBar(
pApp->m_pszProfileName,
IDR_BAR1,
&pArrButtonsIDs,
&nButtonCount,
true,
true,
RGB(255,255,255)
)
);
ASSERT( pArrButtonsIDs != NULL && nButtonCount > 0 );
if( (! m_wndToolBar.Create( NULL, this, AFX_IDW_TOOLBAR ) )
|| (! m_wndToolBar.SetButtons( pArrButtonsIDs,
nButtonCount ) )
)
{
ASSERT( FALSE );
delete [] pArrButtonsIDs;
return -1;
}
delete [] pArrButtonsIDs;
|
|
Saroj Acharya
|
Dec 3, 2004 - 9:59 AM
|
Hi, I would like to detect if my Prof_UIS application has run for the first time. If so, would like to set the initial size and positions of the controlbar, toolbar and menus. I am told that I have to use DockControlBarInnerOuter, DockControlBarLTRB and SetInitDesiredSizeFloating. I have not been able to make use of these functions accurately. Would appreciate if you could guide me through this with a sample code. I call SetInitDesiredSizeFloating right after creating the controlbar, but it is not working. Besides, I don’t know if I have to create my own mechanism to detect the first-time application launch or there already is a way to find out from the registry entries cereated by Prof_UIS. Appreciate your help. Saroj
|
|
Technical Support
|
Dec 4, 2004 - 10:25 AM
|
Dear Saroj, If you need to detect whether your application starts for the first time with regard to the task of setting your control bars’ initial positions, then you have to do nothing because this feature is provided by Prof-UIS. All frame window-based sample applications (SDI, MDI, SDIDOCVIEW, MDIDOCVIEW, ProfStudio, BitmapEditior, FormEditor, DrawCli, StyleEditor, and etc.) distributed with Prof-UIS detect their first startup on any given computer. Please take a look at how the CExtControlBar::ProfileBarStateLoad static method is called in the CMainFrame::OnCreate method in the mentioned above applications. The CExtControlBar::ProfileBarStateLoad method is always called from inside the if( ! ) condition because it returns false if the layout of resizable control bars has never yet been saved to the system registry (i.e. the application runs for the first time and all control bars need to be docked to their initial positions). Please also note that the CExtControlBar::SetInitial...() methods must be called before invoking the Create method of the resizable control bars.
|
|
Ken Knapton
|
Nov 30, 2004 - 5:40 PM
|
Sorry about that last post, i don’t know what happened to the rest of my message. Anyways, I was wondering if there was a control in the prof-uis library that would act as a static docksite for floating windows, similar to CExtControlBar windows that tab inside each other. In the application I am developing, i wish to have a control as the main view that is simply a place to tab windows that will either be floating on the desktop, or tabbed in that view. Is there such support in prof-uis? Any help would be appreciated, Thank you
|
|
Technical Support
|
Dec 1, 2004 - 10:54 AM
|
Typically the frame window-based application contains a set of toolbars and resizable control bars that are floating or docked to frame edges. The central part of the frame window is occupied with the view window in case of SDI applications or with the MDI client area window in case of MDI applications. So, the frame window usually is a pop-up window and all other windows inside the frame are its child windows (the windows inside resizable control bars, toolbar buttons, dialog bars, view windows, status bar panes, and etc.). Of course, you can create the frame window as a child. For instance, you may create the child frame inside the central part of the main frame window (i.e., to replace the view window with the child frame). You may also create the frame window as a child of a resizable control bar that, in its turn, is a child of the main frame window. All these tricks are absolutely possible and limited only by imagination. There is no ready-to-use child frame control in Prof-UIS because we suppose the child frame is not of much use. But it can be used in some cases, for example as an ActiveX control with the dockable control bars. In almost all other cases, it’s not a good idea to deal with the child frame window.
If you only need tabs in the view area of your SDI project, you may use tab page container control similar to that used in the SimpleGrids sample application. If some tabs should be detachable, then it may be reasonable to put these pages into the resizable panels. Anyway, if you provide us with more details on the requirements to the GUI design you need (either by e-mail or here), we will advice you on how to do this in the most appropriate way.
|
|
Ken Knapton
|
Dec 3, 2004 - 11:38 AM
|
A layout like the SimpleGrids sample application is exactly what I’m looking for. The only difference being that as well as having the views tabbed in the main view, i’d like to be able to float them and dock them again in the tabbed view (using a dragging mechanism preferably). I’d use resizable panels, but i’d like for the main view to always be the tabbed view. I’ve thought about simply implemented a menu feature or something to the same effect to "detach" the window from the tabbed views, and by doing so, throwing it into a CExtControlBar at runtime in a floating position, but that seemed like more of a workaround than a solution. Any more suggestions?
|
|
Technical Support
|
Dec 4, 2004 - 10:41 AM
|
Now it is completely clear what you need. Currently Prof-UIS supports detachable tabs only for resizable control bar windows. The tabs in main views may be implemented either by means of the MDI interface or by using the tab page container as a view window in case of the SDI interface. But in both cases these tab containers does not support the tab detaching to make the corresponding windows floating. This feature is in our TO-DO list.
|
|
Ken Knapton
|
Dec 7, 2004 - 2:06 PM
|
That is great, I look forward to the time when that feature is implemented. I am interested to know if this feature has a possibility of being implemented by June-July 2005?
|
|
Technical Support
|
Dec 8, 2004 - 2:12 AM
|
To implement the detachable tab views is not extremely difficult if the MFC document/view architecture is not used. We need some time to analyze how to do this in the most appropriate way. But hope that you will get this feature much earlier than June 2005.
|
|
Ken Knapton
|
Nov 29, 2004 - 3:44 PM
|
|
|
Artur Shingirei
|
Nov 29, 2004 - 9:28 AM
|
Hello.
I created a ListCtrl at resource editor on the dialog form. After I did add it to the container CExtTabPageContainerFlatWnd as
VERIFY( m_wndTabPageContainerFlat.PageInsert( &m_ListCtrlEdit, _T("ListCtr") ) );
but I meets with problem: I did add an Event Handler for CListCtrl:
Message Map: .... ON_NOTIFY(NM_DBLCLK, IDC_LIST, OnDblClick) ...
void CMyDialog::OnDblClick(NMHDR *pNMHDR, LRESULT *pResult) { } But when I do double click on Item at ListCtrl. I do not get in OnDblClick(...). What I should to do for resolve this problem?I do not want to create my CListCtrl dynamicly.
|
|
Technical Support
|
Nov 30, 2004 - 9:53 AM
|
What about using a class derived from CListCtrl in way like this?class CMyListCtrl : public CListCtrl
{
public:
CMyListCtrl();
virtual ~CMyListCtrl();
// Generated message map functions
protected:
//{{AFX_MSG(CMyListCtrl)
afx_msg void OnDblclk(NMHDR* pNMHDR,
LRESULT* pResult);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CMyListCtrl::CMyListCtrl()
{
}
CMyListCtrl::~CMyListCtrl()
{
}
BEGIN_MESSAGE_MAP(CMyListCtrl, CListCtrl)
//{{AFX_MSG_MAP(CMyListCtrl)
ON_NOTIFY_REFLECT(NM_DBLCLK, OnDblclk)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// CMyListCtrl message handlers
void CMyListCtrl::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
*pResult = 0;
}
|
|
Artur Shingirei
|
Nov 29, 2004 - 8:19 AM
|
Hello.
I used CExtTabPageContainerFlatWnd as a base class for custom control. My TabPageContainer contain more one Tab. I need to make some initialize of controls inside container before appearing of form when I did click at tab on the TabPageContainer.
What method of CExtTabPageContainerFlatWnd I need to redefine or make something else?
|
|
Technical Support
|
Nov 30, 2004 - 2:39 AM
|
Dear Artur, Create a class derived from the CExtTabPageContainerFlatWnd class and override this method:virtual bool
CExtTabPageContainerFlatWnd::OnTabWndSelectionChange(
LONG nOldItemIndex,
LONG nNewItemIndex,
bool bPreSelectionTest
)
{
bool bRetVal =
OnTabWndSelectionChange(
nOldItemIndex,
nNewItemIndex,
bPreSelectionTest
);
if( bRetVal )
{
if( bPreSelectionTest )
{
/// POINT A:
/// BEFORE A NEW PAGE BECOMES ACTIVE
/// (the previous page window is still on the top
...
}
else
{
/// POINT B:
/// WHEN THE NEW PAGE IS ACTIVATED
/// (the new page is visible)
...
}
}
return bRetVal;
} As the comments imply, you have two points where you can initialize the page. At the point A you may return false to disable selection of the tab item (this may be useful if your initialization code for this page fails for some reason).
|
|
Ulrich Kallenbach
|
Nov 23, 2004 - 7:58 AM
|
Hi, how can I set how the captions are display for docked contral bars. For example: By default, if docked to the left of the frame window and in auto-hide mode the caption is displayed in a tab using a top-down oriented font. How can the font be changed to bottom-up? If two control bar are docked inside each other the captions are shown in tabs located at the bottom of the docked group. How to display the tabs at the top of the group? I believe I have seen this in the examples or somewhere in the forum, but I not sure. At least, I cannot remember exactly where. Could you please give me a hint? Thanks, Ulrich
|
|
Technical Support
|
Nov 24, 2004 - 7:41 AM
|
Create a class derived from CExtControlBar and override the virtual method below in it:virtual void OnGetBarCaptionText(
e_bar_caption_text_t eBCT,
CExtSafeString & strCaptionText
) const; In the new method, put string values to strCaptionText (which is an output parameter) depending on the eBCT argument which can have the following values:
__EBCT_SINGLE_CAPTION_DOCKED - your method returns the caption of the control bar that is docked independently from other control bars
__EBCT_SINGLE_CAPTION_FLOATING - your method returns the caption of the control bar that is in the floating state in its own mini frame window
__EBCT_TAB_GROUP_CAPTION_DOCKED - your method returns the caption of the tab group when the control bar is selected in the tab group and this group is in the docked state
__EBCT_TAB_GROUP_CAPTION_FLOATING - your method returns the caption of the tab group when the control bar is selected in the tab group and this group is in the floating state
__EBCT_TAB_ITEM_CAPTION - your method returns the caption of the tab item
__EBCT_AUTOHIDE_ITEM_CAPTION - your method returns the caption of the grouped tab item in the autohide tabs
__EBCT_AUTOHIDE_SLIDER_CAPTION - your method returns the caption of the window which slides out from the autohide tabs.
You can also change the font orientation in the vertical autohide tabs. These autohide tabs are child windows of the main frame window and they are instances of the CExtDynAutoHideArea class derived from the CExtTabWnd class (to make the CExtDynAutoHideArea type visible for the compiler, you need to include the ../Src/ExtControlBarTabbedFeatures.h file). So, you may walk through all child windows of the main frame window and get their CWnd pointers. For each CWnd you may apply DYNAMIC_DOWNCAST to the CExtDynAutoHideArea type. You will get four pointers of the CExtDynAutoHideArea type. The last two of them are vertical autohide tab windows and you may make them change the vertical font direction by calling the CExtTabWnd::ModifyTabWndStyle( 0, __ETWS_INVERT_VERT_FONT, true ) method.
There is no easy way to show tabs at the top of the tab group now. We will regard this as a feature request.
|
|
Saroj Acharya
|
Nov 22, 2004 - 3:54 PM
|
Hi Tech Support, It sounds silly to ask this question but I am struggling with this. I wanted to add key board functionality in my code (which is derived from DrwaCLI sample code) so that when F1 or F2 is pressed, I could do certain things within my code. I had tried processing OnChar() or WM_CHAR messahge in my MainFrame.cpp or in any other view, I never get this message ? ANy idea why such a simple thing is not working with my application ?? Same thing happened when I tried to add keyboard processing in your DrawCLI sample code. Looks like the problem exists in both. Your help is highly appreciated. Saroj
|
|
Technical Support
|
Nov 23, 2004 - 9:11 AM
|
Only one window at a time can have focus. This window receives all keyboard messages. This is true for any Windows OS. When the main frame window gets focus, it automatically sets focus to the active view window. This is true both for your application and for our version of DrawCli. So, in most cases the focused window in your application is a view window. If you have resizable control bars with some child windows inside, then the user may set focus to these windows (for instance, with the mouse).
To handle keyboard events in the main frame, you may assign key combinations to the required commands in the accelerator table and then add the command handlers to the main frame window. You may also override the PreTranslateMessage virtual method in the main frame and return TRUE when the WM_KEYDOWN message is received and wParam is equal to an appropriate key constant (for example, the VK_F1 ). So, you may use either method.
|
|
Jacquie Howard
|
Nov 22, 2004 - 3:46 PM
|
Please tell me how to set radio marks on my menu items (like on Windows Explorer when choosing between thumbnails, list, icons, etc view in the View menu.
|
|
Jacquie Howard
|
Nov 22, 2004 - 4:46 PM
|
It’s OK - I figured it out from the example in FunnyBars that I discovered immediately after posting. Thanks
|
|
Olga Burlakova
|
Nov 19, 2004 - 1:11 AM
|
Hello.
I have some trouble with CExtControlBar.
I create a two MDI Projects using Prof-UIS 2.25.1, I used (Prof-UIS ) App wizard for this. All option for each project I leave by default. At One app I used a CView as base class for View and CFormView at another. I created Resizable Bar at each application at Child window (CChildFrame).
// CChildFrame message handlers
int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1) return -1;
if( !m_wndResizableBar.Create( _T("Bar1"), this, ID_VIEW_CHILDFRAME_BAR_FILTER ) ) { TRACE0("Failed to create Bar1\n"); return -1; // fail to create }
if( !m_wndInBarDlg.Create( IDD_IN_BAR_DLG_DOC, &m_wndResizableBar ) ) { TRACE0("Failed to create m_wndInBarDlg\n"); return -1; // fail to create }
m_wndInBarDlg.ShowSizeGrip( FALSE );
if( !CExtControlBar::FrameEnableDocking(this) ) { ASSERT( FALSE ); return -1; }
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS) if( !CExtControlBar::FrameInjectAutoHideAreas(this) ) { ASSERT( FALSE ); return -1; } #endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
m_wndResizableBar.EnableDocking(CBRS_ALIGN_ANY); m_wndResizableBar.DockControlBar( AFX_IDW_DOCKBAR_LEFT, 1,this,false ); return 0; }
The problem consists in following: in the second application arise problem with representation of Resizable Bar. After the panel was latent. I move the cursor to the Bar area, but Bar does not leave back. In the First Application all works perfectly.
|
|
Technical Support
|
Nov 22, 2004 - 1:45 AM
|
Dear Olga,
Could you send us a test application which demonstrates this problem. That will help us quickly clarify the issue and find out what’s wrong with your application.
|
|
Christophe Guibert
|
Nov 18, 2004 - 4:09 AM
|
Dear Sir, There might be two bugs in CExtBarColorButton, when using them in a toolbar ni a child frame window : 1. When using the icon CExtBarColorButton::e_def_icon_type_t::__DIT_CHAR, we obtain a black box instead of a colored "A" char. However, when the button is disabled, the gray "A" char is correctly displayed. 2. When using the icon CExtBarColorButton::e_def_icon_type_t::__DIT_FRAME, there are "dirty" pixels around the frame. This has been noticed on a Windows 98 SE system (correct with Windows 2000 and XP). An image describing the problems can be found at http://chrguibert.free.fr/Image4.png. Best Regards, Christophe Guibert
|
|
Technical Support
|
Nov 22, 2004 - 1:29 AM
|
Dear Christophe,
Thank you for the bug report! We fixed it and will provide you with an update by e-mail.
|
|
Saroj Acharya
|
Nov 17, 2004 - 2:46 PM
|
Hi, I would like to use BITMAP for the CExtButtons on my CExtControlBar (which contains dialog box). I know it is very easy to load the ICONS using the following lines of code...but not sure if there is a similar function for Bitmaps. m_BtnStartLive.SetIcon(ID_SCPPV_NEXT); where ID_SCPPV_NEXT is ID for the icon. Thanks, Saroj
|
|
Saroj Acharya
|
Nov 17, 2004 - 3:02 PM
|
Also please note that the following lines of code does not work in my application:
m_BtnPrint.SetBitmap(::LoadBitmap(NULL, MAKEINTRESOURCE(IDB_BITMAP_CAMERA)));
Thanks,
Saroj
|
|
Technical Support
|
Nov 18, 2004 - 3:14 AM
|
You cannot use HBITMAP objects inside the CExtButton windows directly. But you can use HICON instead. To convert HBITMAP to HICON , the following code may be used:HBITMAP hBmp = ...
COLORREF clrTransparentPixels = ...
CExtCmdIcon _icon( hBmp, clrTransparentPixels );
::DeleteObject( hBmp );
HICON hIcon = _icon.DetachAsHICON( false );
m_wndExtButton.SetIcon( hIcon );
|
|
Olga Burlakova
|
Nov 16, 2004 - 8:55 AM
|
Hello.
I try to create Resizable control Bar inside Child window of MDI Application(Doc/View Architecture) My child window is CFormView. I saw this at Your sample-MDI_InnerOuterBars. I did override CChildFrame::OnCreate and no entry in this function while run the application.
How I can create a Resizable control Bar inside Child window?
|
|
Technical Support
|
Nov 17, 2004 - 2:19 AM
|
Any dockable control bar window, regardless whether it is based on the MFC CControlBar class, or on the Prof-UIS CExtControlBar , is designed to interact with a frame window (e.g., CFrameWnd , CMDIFrameWnd , or CMDIChildWnd ). It is always linked to its frame window. You cannot insert a dockable control bar into a window that is not based on CFrameWnd , like a dialog or view. Your main MDI frame window contains the MDI client area window, which is usually dark grey. It serves as a container for MDI child frames (CMDIChildWnd ). These child frames are containers for their view windows and may have their own control bars. We suppose you have initialized the control bar in the CChildFrame::OnCreate method correctly and this method should be called when a child frame is created. It may not be called if you have manually removed the ON_WM_CREATE macro from the message map of the CChildFrame class. So, to clarify the problem we need to take a look at your source code. You may send it to us via e-mail.
|
|
Olga Burlakova
|
Nov 17, 2004 - 6:33 AM
|
Hello. I did check my code... Sorry, I realy forgot to add to the code OnCreate in Message Map.
I successful created a Bar. But I seems with following problem: My Resizable Control Bar contain a dialog inside but when application start the Bar is empty.
Child window where I create a Resizable Control Bar is derived from CFormView. I did override some function like
BOOL CDocListView::PreTranslateMessage(MSG* pMsg) { if (WM_KEYFIRST <= pMsg->message && pMsg->message<= WM_KEYLAST) { if (m_hAccel && ::TranslateAccelerator(m_hWnd, m_hAccel, pMsg)) return TRUE; }
return CFormView::PreTranslateMessage(pMsg); } and
void CDocListView::OnSize(UINT nType, int cx, int cy) { CFormView::OnSize(nType, cx, cy); if(bInitComplete == TRUE) { GetClientRect(&rect); rect.left = rect.left+250; m_ListCtrl.MoveWindow(&rect); } }
And CChildFrame class code.
int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1) return -1;
if( !m_wndResizableBar.Create( _T("Panel"), this, ID_VIEW_CHILDFRAME_BAR_FILTER ) ) { TRACE0("Failed to create Panel\n"); return -1; // fail to create }
if( !m_wndInBarDlg.Create( IDD_IN_BAR_DLG_DOC, &m_wndResizableBar ) ) { TRACE0("Failed to create m_wndInBarDlg\n"); return -1; // fail to create }
m_wndInBarDlg.ShowSizeGrip( FALSE ); if( !CExtControlBar::FrameEnableDocking(this) ) { ASSERT( FALSE ); return -1; } #if (!defined __EXT_MFC_NO_TAB_CONTROLBARS) if( !CExtControlBar::FrameInjectAutoHideAreas(this) ) { ASSERT( FALSE ); return -1; } #endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
m_wndResizableBar.EnableDocking(CBRS_ALIGN_ANY); m_wndResizableBar.DockControlBar( AFX_IDW_DOCKBAR_LEFT, 1 ); return 0; } BOOL CChildFrame::OnBarCheck(UINT nID) { return CExtControlBar::DoFrameBarCheckCmd( this, nID, true ); } void CChildFrame::OnUpdateControlBarMenu(CCmdUI* pCmdUI) { CExtControlBar::DoFrameBarCheckUpdate( this, pCmdUI, true ); }
|
|
Technical Support
|
Nov 18, 2004 - 3:00 AM
|
The source code looks absolutely correct. We guess that your dialog is also successfully created as a child window of the resizable control bar. It seems the dialog window is simply invisible. Please check the Visible property of your dialog resource. Alternatively you can invoke the ShowWindow method of your dialog when it is created.
|
|
Christophe Guibert
|
Nov 15, 2004 - 1:55 PM
|
Dear Sir, Compiling current ProfUIS 2.26 libraries causes 5 compilation errors with Visual C++ 6.0 sp6 : --------------------Configuration: profuislib - Win32 Static MBCS Debug-------------------- Compiling... ExtCmdManager.cpp c:\program files\microsoft visual studio\vc98\include\transact.h(226) : error C2059: syntax error : ’constant’ c:\program files\microsoft visual studio\vc98\include\transact.h(271) : error C2143: syntax error : missing ’;’ before ’}’ c:\program files\microsoft visual studio\vc98\include\oledb.h(17149) : error C2143: syntax error : missing ’;’ before ’}’ c:\program files\microsoft visual studio\vc98\include\oledb.h(17149) : error C2143: syntax error : missing ’;’ before ’}’ c:\program files\microsoft visual studio\vc98\include\oledb.h(17149) : error C2143: syntax error : missing ’;’ before ’}’ Prof-UIS is automatically linking with version.lib (Version info support) Error executing cl.exe. ProfUIS226smd.lib - 5 error(s), 0 warning(s) Other builds (DLL, release...) give the same errors. Note : An older 2.26 download (October 19th, without the latest patch) gives no error. Could you give me a hint please ? Best Regards, Christophe Guibert
|
|
Technical Support
|
Nov 16, 2004 - 5:16 AM
|
Dear Christophe,
We have carefully tested Prof-UIS 2.26 with Visual Studio 6.0 (VS 6.0, VS 6.0 SP5, and VS 6.0 SP6). Many of our users use Visual Studio 6.0 and Service Pack 6. Nobody reported this problem before. So, we assume the compilation error is caused by some other Visual Studio update like Platform SDK. If you have Platform SDK installed, let us know. Please also provided us with a list of include directories in your Visual Studio 6.0 (menu Tools/Options, Directories tab).
|
|
Christophe Guibert
|
Nov 17, 2004 - 3:23 AM
|
Dear Sir, Good guess : I effectively use the platform SDK (February 2003). If I remove it (the include / bin / lib paths), ProfUIS is correctly compiled but my program won’t benefit of the latest platform SDK. Here are the include paths, as set by the SDK installation program, and for which the compilation fails : C:\MicrosoftSDK\include C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE C:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE Z:\ProfUIS\include If I move "C:\MicrosoftSDK\include" after C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE the compilation is OK, but it seems highly dangerous since there are hundreds of include files with names conflicts between the SDK and Visual C++ files... So the questions are : am I authorized to do that ? What can I do ? Do you have any idea ? Best Regards, Christophe Guibert, Web Idea Tree, content manager and web site builder software. www.webideatree.com
|
|
Technical Support
|
Nov 17, 2004 - 3:54 AM
|
You are using Platform SDK which has been primarily created for Visual Studio .NET.
MFC 4.2, which is distributed with Visual Studio 6.0, was compiled with older Win32 header files. This fact explains the problem. We designed Prof-UIS to be compatible with all versions of Visual C++ and with all versions of Windows (starting from version 4.0 (95 or NT)). You probably noticed that all projects have the following preprocessor symbol definitions:_WIN32_WINNT=0x0400
_WIN32_IE=0x0400 These symbols make the compiler/linker use the Win32 features that are available exactly in Windows 95 or Windows NT 4.0. We also use later Windows API but the Prof-UIS source code detects these DLLs and their exported functions dynamically. In our opinion, there are no significant features added by Microsoft to their Win32/GDI APIs in the Windows OSes with versions greater than 4.0 (since the release of Windows NT 4.0 in 1996).
You have changed the priority of the Platform SDK paths under the Directories tab. It is not dangerous but you will probably have no access to some features defined in new SDK headers because your source code will "see" the older versions of these features. You may try to use Platform SDK until you encounter difficulties. Anytime you may split your project into several DLLs or COM servers/clients and resolve any compilation conflicts.
|
|
Christophe Guibert
|
Nov 18, 2004 - 2:00 AM
|
Dear Sir, In other words, the Prof-UIS library can’t be used with the Platform SDK... Nevertheless, I could eliminate any dependency with this Platform SDK in my program, and removed the SDK ! So everything is OK now. Best Regards, Christophe Guibert
|
|
Saroj Acharya
|
Nov 12, 2004 - 11:32 AM
|
Hi, I am trying to create a toobar with a Combobox and few buttons on it so that I could type in a Text on the combobox and the place/remove the text on my View when certain buttons on the same toolbar is clicked. I have been able to create the Combo box along with the buttons on the same toobar using the following lines of code. But the problem is that the Combobox is not fully visible and the toolbar is too small to fit all the buttons. I cannot make this bar longer and when I increase the size in Y-direction, I could see the other buttons but Combobox is clipped. Can you help me to get this problem solved ? Thanks, Saroj Code used to create the toolbar:
CExtComboBox m_wndComboWebLoaction;
CExtToolControlBar m_wndToolBarWeb;
BOOL CMainFrame::OnCreate(..)
{
:
CreateTextAnnotationToolBar();
m_wndToolBarWeb.EnableDocking(CBRS_ALIGN_ANY);
:
DockControlBar(&m_wndToolBarWeb);
:
}
BOOL CMainFrame::CreateTextAnnotationToolBar()
{
static const UINT arrWebTbBtns[] =
{
ID_ANNOTATION_DEFINE_TEXT,
ID_SEPARATOR,
ID_ANNOTATION_DEFINE_TEXT,
};
if( !m_wndToolBarWeb.Create(_T("Text Annotation Toolbar"), this, ID_VIEW_TEXT_ANNOTATION_TOOLBAR )
|| !m_wndToolBarWeb.SetButtons( arrWebTbBtns, sizeof(arrWebTbBtns)/sizeof(arrWebTbBtns[0]) )
)
{
TRACE0("Failed to create m_wndToolBarWeb\n");
return(FALSE); // fail to create
}
if( !m_wndComboWebLoaction.Create(
WS_CHILD | WS_VISIBLE | CBS_DROPDOWN,
CRect(0,0, 300, 500),
&m_wndToolBarWeb,
ID_ANNOTATION_DEFINE_TEXT
)
)
{
TRACE0("Failed to create ID_WEB_URL\n");
return(FALSE); // fail to create
}
VERIFY(m_wndToolBarWeb.SetButtonCtrl(m_wndToolBarWeb.CommandToIndex(m_wndComboWebLoaction.GetDlgCtrlID()),&m_wndComboWebLoaction) );
m_wndComboWebLoaction.SetFont(CFont::FromHandle((HFONT)::GetStockObject(DEFAULT_GUI_FONT)) );
m_wndComboWebLoaction.SetItemHeight(-1, m_wndComboWebLoaction.GetItemHeight(-1) - 1 );
return(TRUE);
}
|
|
Technical Support
|
Nov 15, 2004 - 2:16 AM
|
The source code in your message is correct. To clarify the issue, we need a screenshot or source code of your application.
|
|
Saroj Acharya
|
Nov 11, 2004 - 2:32 PM
|
Hi, Are these new samples (as shown on the web page) part of version 2.26 or they are only available with this Frame feature ? I am specially interested in DrawCLI sample application. Thanks, saroj
|
|
Technical Support
|
Nov 12, 2004 - 2:34 AM
|
All samples listed on the Samples page except for ThemeColorizer are are already available in Prof-UIS 2.26. The new ThemeColorizer sample is implemented with Prof-UIS 2.27, which we plan to release next week.
|
|
Saroj Acharya
|
Nov 12, 2004 - 11:13 AM
|
Hi, I have latest Prof_UI V2.26 installed in my computer. I downloaded both V2.26 and the patch and re-installed it again just in case I am missing any of the new files. I still get the old style sample applications. For example, in your sample window on the web site, the DrawCLI application has got Text along with the Line Icon. In my sample application, I just get the line Icon as I used to have earlier. AM I missing something ? I would like to modify my application so that it would look same as in your sample application on the web. Saroj
|
|
Technical Support
|
Nov 15, 2004 - 2:12 AM
|
Dear Saroj,
We are not sure what you mean exactly. If you mean, how to display both an icon and text on the toolbar button, then let us know. If you mean something else, please give us more details on your question or send us a screenshot.
|
|
Olga Burlakova
|
Nov 10, 2004 - 8:26 AM
|
Hello.
I created MDI application.
I want to use one menu (IDR_MAINFRAME) for all type of opened (created) documents. I change name of each menu item as : void CMainFrame::OnCreate(....) { .... CExtBarButton * pExtButton = NULL; CExtCmdItem * pCmdItem = NULL;. pExtButton = m_wndMenuBar.GetButton(0); nIDTmp = pExtButton->GetCmdID(); pCmdItem = g_CmdManager->CmdGetPtr(g_CmdManager->ProfileNameFromWnd(m_wndMenuBar.GetSafeHwnd()),nIDTmp); pCmdItem->m_sToolbarText = "Item One";
return 0; }
When I create a new document (window) the menu is changing to IDR_... menu of document, I deleted all menu from resource except IDR_MAINFRAME. All looks like Ok. But when I try to maximize the child window, all Items at topmenu is changing name to default how they defined at resource.
How I can to solve this problem?
|
|
Olga Burlakova
|
Nov 11, 2004 - 7:28 AM
|
I use Doc/View architecture.
The problem is, that after I have renamed the name of items of the menu(main menu) in a method CMainFrame:: OnCreate at maximize of child window there is a change of the name of all items of the menu (main) on initial (as they are defined in resources)
Example : Menu is defined as: File | Edit | View | Open New .... I change name "File"to "Item One" Item One | Edit | View | Open New .... When I maximize child window names "Item One" was change to File. How to redraw menubar or do something else that so that after change of the size(maximize/ minimize) of child window was kept "Item One"?
|
|
Technical Support
|
Nov 10, 2004 - 11:14 AM
|
Dear Olga, To implement a single menu line for all types of MDI windows/documents is not difficult. First of all, please make sure that you have removed all document menu resources like IDR_somethingTYPE . You need only the IDR_MAINFRAME resource. Of course, you may create any other menu resources like context menus.
A. If your app is NOT based on the document/view architecture, you should use the following code in the CYourApp::InitInstance method: HINSTANCE hInst = AfxGetResourceHandle();
m_hMDIMenu =
::LoadMenu( hInst, MAKEINTRESOURCE(IDR_MAINFRAME) );
m_hMDIAccel =
::LoadAccelerators( hInst,
MAKEINTRESOURCE(IDR_MAINFRAME)
);
And the code responsible for creating new MDI child windows may look like: void CYourApp::OnFileNew()
{
CMainFrame * pFrame =
STATIC_DOWNCAST( CMainFrame, m_pMainWnd );
pFrame->CreateNewChild(
RUNTIME_CLASS(CChildFrame),
IDR_MAINFRAME,
m_hMDIMenu,
m_hMDIAccel
);
}
You may take a look at the MDI sample application and easily convert it into a single-menu-based application if you remove the IDR_MDITYPE resource and replace this preprocessor symbol with IDR_MAINFRAME in all source files of this sample. You also need to remove the following lines at the beginning of the CMainFrame::OnCreate method: VERIFY(
g_CmdManager->UpdateFromMenu(
pApp->m_pszProfileName,
IDR_MDITYPE
)
);
B. If your app is based on the document/view architecture, then replace IDR_somethingTYPE with IDR_MAINFRAME when the document template is registered: CMultiDocTemplate * pDocTemplate =
new CMultiDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CYourDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CYourView)
);
AddDocTemplate( pDocTemplate );
This is usually done in the CYourApp::InitInstance method. Additionally you should not update the command manager from the IDR_somethingTYPE menu. Now you can safely remove the menu from your document/view based MDI application.
In any case, you should not access buttons in the menu bar because it automatically rebuild them when the active MDI child window is changed, closed, or opened. If you have separate accelerator tables for documents in your application, then you may also safely remove them.
|
|
Olga Burlakova
|
Nov 11, 2004 - 7:34 AM
|
I use Doc/View architecture.
The problem is, that after I have renamed the name of items of the menu(main menu) in a method CMainFrame:: OnCreate at maximize of child window there is a change of the name of all items of the menu (main) on initial (as they are defined in resources)
Example : Menu is defined as: File | Edit | View | Open New .... I change name "File"to "Item One" Item One | Edit | View | Open New .... When I maximize child window names "Item One" was change to File. How to redraw menubar or do something else that so that after change of the size(maximize/ minimize) of child window was kept "Item One"?
|
|
Technical Support
|
Nov 12, 2004 - 2:23 AM
|
To set custom text for a button in the menu bar without having to repaint the menu bar window, create a new class derived from CExtMenuControlBar and override the _UpdateMenuBar internal virtual method in this way:BOOL CYourMenuControlBar::_UpdateMenuBar(
BOOL bDoRecalcLayout // = TRUE
)
{
// Invoke the parent’s method to reinitialize
// all the buttons as is
BOOL bRetVal =
CYourMenuControlBar::_UpdateMenuBar( FALSE );
// Find the first button
int nCount = GetButtonsCount();
for( int nIdx = 0; nIdx < nCount; nIdx++ )
{
CExtBarButton * pTBB = GetButton( nIdx );
ASSERT_VALID( pTBB );
if( pTBB->IsKindOf(
RUNTIME_CLASS(CExtBarMdiDocButton)
)
|| pTBB->IsKindOf(
RUNTIME_CLASS(CExtBarMdiRightButton)
)
)
continue;
// First button found, get its command item from
// the command manager and update the command
//item’s text in the toolbar
CExtCmdItem * pCmdItem =
g_CmdManager->CmdGetPtr(
g_CmdManager->ProfileNameFromWnd( m_hWnd ),
pTBB->GetCmdID( false )
);
ASSERT( pCmdItem != NULL );
pCmdItem->m_sToolbarText = _T("Item One");
break;
}
// Recalculate layout if needed
if( bDoRecalcLayout )
{
Invalidate();
_RecalcLayoutImpl();
UpdateWindow();
}
return bRetVal;
} This method is called each time when the menu bar needs to be updated. So, you have complete control over the properties of all buttons in the menu bar.
|
|