Subject |
Author |
Date |
|
Raphael Gruaz
|
Jun 19, 2006 - 4:03 AM
|
Hi! I am writing an MDI app using CExtTabMdiWhidbeyWnd I just face 3 problems (one bigger than the others):
- Why the size of the document is not stored? for instance, if I open a new MDI doc, maximize it, close it, then open another new document, the new one will appear windowed and not maximized. is there anything I can do, or do I have to implement this "memory" mechanics by myself?
- when I open many document and maximize them, and when I use the tabs to switch from one to another, I can see clearly the "soon to be the active doc" in a windowed state before it is displayed as maximized. Of course, it’s short, but it is really bothering. (this is my bigger problem)
- is there an automated way to hide the tabs when the MDI docs are displayed in a windowed mode?
Actually, I could solve the first and the third problem by myself, but i am quite stucked by the 2nd.
Best regards,
Raph
|
|
Technical Support
|
Jun 19, 2006 - 10:56 AM
|
We do not save/restore the window placement for MDI child frames because we have no enough information to identify each MDI child frame window. In fact, only your application knows how to distinct one open MDI child frame from another. Each child frame may be identified by some unique information specific for your document object and by its corresponding view window. So Prof-UIS does not simply know what each MDI child frame is? For instance, each control bar (toolbar, resizable bar, status bar and etc) can be identified with the dialog control identifier of the control bar window. This dialog control identifier is unique for each bar and that is why we can use it as command identifier in the menu for switching its visibility. We are using this identifier when saving/restoring control bar states. But an MDI child frame has nothing unique to be identified with. Besides only your application knows how to create MDI child frames and correctly open and attach the document and the view to it. Finally there are MDI applications without document/view architecture. In this case we know nothing about MDI child frames but their window handles at run time. We did some search and found the following article with this: http://www.codeproject.com/docview/persistframes.asp. The flicker effect is a well known bug of Windows MDI interface on Windows XP or later OS version. You can see this bug in any MDI application running on Windows XP: Visual C++ 6.0 IDE and Visual Studio .NET/2005 IDE configured to use the standard MDI interface instead of their written from scratch tabbed interfaces. Prof-UIS 2.54 fixes this bug automatically if you are using the CExtMenuControlBar instead of the standard menu line in the MDI main frame window. You can fully control the visibility of the MDI tab control. Just override the CExtTabWnd::OnTabWndSyncVisibility() virtual method and simply show or hide the tab window depending on your conditions. The default method’s implementation hides the MDI tab window if there are no MDI child frames present. The ProfStudio sample application implements the custom MDI tab control for emulating tabbed and MDI classic interfaces switchable on-the-fly dependently on user preferences.
|
|
Daljit Singh
|
Jun 18, 2006 - 11:39 PM
|
I am developing an application which has a dialog. On that dialog, I created a tab container. This tab container has two tabs. One has the tree control (CExtWFF<CTreeCtrl>) on it. The dialog box is not getting any notification message (like TVN_SELCHANGED, NM_CLICK) from the tree control. If I use the tree control directly on the dialog then it works. Could you please suggest any solution. Is it a problem? is there any other way of doing. Here is an example how I am using. Please let me know what is wrong.
Thanks.
BEGIN_MESSAGE_MAP(CPolicyEditor, CExtResizableDialog) //{{AFX_MSG_MAP(CPolicyEditor) NOTIFY(TVN_SELCHANGED, IDC_TREE_POLICY_EDITOR2, OnSelchangedTreePolicyEditor) ON_NOTIFY(NM_CLICK, IDC_TREE_POLICY_EDITOR2, OnClickTreePolicyEditor) //}}AFX_MSG_MAP END_MESSAGE_MAP()
CExtTabPageContainerFlatWnd m_tabPolicyEditor; CExtWFF<CTreeCtrl> m_policytree;
//The following codes are called in OnInitDialog() m_tabPolicyEditor.Create( this, CRect(0,0,0,0));
if( !m_policytree.Create( WS_CHILD | WS_VISIBLE|WS_VSCROLL|WS_HSCROLL|WS_TABSTOP |TVS_HASBUTTONS|TVS_HASLINES|TVS_LINESATROOT |TVS_INFOTIP|TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS,
CRect(0,0,0,0), //rect, &m_tabPolicyEditor, //this, UINT(IDC_TREE_POLICY_EDITOR2) ) ) { TRACE0("Failed to create TreeCtrl\n"); return FALSE; // fail to create }
HICON hIcon = (HICON)::LoadImage( ::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_TREE), IMAGE_ICON, 16, 16, 0 ); VERIFY( m_tabPolicyEditor.PageInsert( &m_policytree, _T("Parameters"), hIcon, true ) ); hIcon = (HICON)::LoadImage( ::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_LIST), IMAGE_ICON, 16, 16, 0 ); VERIFY( m_tabPolicyEditor.PageInsert( &m_listProperties, _T("Parent Policy"), hIcon, true ) );
|
|
Technical Support
|
Jun 19, 2006 - 10:37 AM
|
The notification messages are sent to the parent window only. The tree window inside the tab page has the tab page container window as the parent and not the dialog. That is why your dialog does not receive notification messages. So just create a CTreeCtrl -derived class and handle all the tree events inside this class.
|
|
Lynn Reid
|
Jun 17, 2006 - 11:24 PM
|
Hi: I’m very new to Prof-UIS (like this week!). I’m trying to convert an existing application to use Prof-UIS. I’ve got the tabbed windows working for my MDI Clients. Before any documents are opened, how do I paint the background of the clients? e.g. how do I make the "interior" of the Mainframe show up a company logo? I have taken a look at the TabbedBars example and it is quite overwhelming. I don’t need the bitmap to be consistent across toolbars, or work with any theme, etc. -- just to show up! The bitmap should be tiled.
I have implemented the OnMsgPaintInheritedBackground registered message in my CMDIChildWnd class -- but since it is never even called I’m clearly doing something wrong. Please, can you start from the beginning on changing my CMDIChildWnd class and pretend I’m an idiot? Many thanks.
|
|
Technical Support
|
Jun 19, 2006 - 3:19 AM
|
The TabbedBars sample really demonstrates this advanced feature of Prof-UIS paint managers: painting of complex inherited backgrounds. This feature is turned off by default. That is why your message handlers are not invoked. To turn it on, please use the following code: g_PaintManager->m_bCustomBackgroundInheritanceEnabled = true; This line should be invoked in two cases: during startup and when the active paint manager changes.
|
|
Ed Kennedy
|
Jun 17, 2006 - 10:29 AM
|
Is there a wrapper class for CListView and CTreeView to give them proper look and feel?
Thanks,
ed
|
|
Technical Support
|
Jun 17, 2006 - 11:33 AM
|
There are no extended versions if these classes in Prof-UIS, but two much more powerful controls are available: CExtGridWnd and CExtTreeGridWnd . Here is a project that shows how to use CExtTreeGridWnd .
|
|
Thomas Maurer
|
Jun 16, 2006 - 9:36 AM
|
Hello
Is there a notification message when the autohide pin is pinned or unpinned?
Thank you
Thomas
|
|
Technical Support
|
Jun 17, 2006 - 11:25 AM
|
Please create a CExtControlBar -derived class and override AutoHideModeSet() virtual method in it. This method turns on/off the auto-hide mode for the control bar. Do not forget to invoke the base class’s method.
|
|
Thomas Maurer
|
Jun 19, 2006 - 3:45 AM
|
|
|
Thomas Maurer
|
Jun 16, 2006 - 8:03 AM
|
Hello
I noticed that by selecting/activating certain MDI tabs the order of the tabs is not left->right anymore. In the following screenshot
http://www.ierax.ch/download/taborder.jpg
If I press Ctrl-Tab the order is a.tif->c.tif->d.tif->b.tif->a.tif... instead of a->b->c->d
Why does this happen? Can I prevent this?
Thanks in advance
Thomas
|
|
Technical Support
|
Jun 17, 2006 - 11:09 AM
|
Actually we do not change the default behavior of the Ctrl+Tab key. We just handle the WM_MDIACTIVATE message to synchronize the active child widow with currently selected tab item. So this is standard behavior of the MDI application.
|
|
Thomas Maurer
|
Jun 19, 2006 - 3:49 AM
|
Thank you for your answer. Of course you are right, I came to the same conclusion when I thought about it. Pressing Ctrl-Tab twice should get you back to the original document and so this order has to be modified.
However, in our scenario we would be glad if we could get our hands onto the physical list of mdi tabs. If I have a tab is there an easy way to find out which tab lies left/right of it? Or do I have to maintain this list myself?
|
|
Technical Support
|
Jun 19, 2006 - 10:35 AM
|
You can override the WindowProc() virtual method and handle the Ctrl+Tab click event to implement custom window switching. Just get an index of the currently selected tab using the SelectionGet() method, increase the index, and activate the next tab using the SelectionSet() method.
Please note that each tab item has an HWND handle associated with it. This handle is a window handle of the child frame window. You can retrieve this handle with the ItemLParamGet() method.
|
|
Thomas Maurer
|
Jun 20, 2006 - 3:16 AM
|
This works fine. Thank you very much.
Thomas
|
|
Massimo Germi
|
Jun 16, 2006 - 6:30 AM
|
Hi, is possible to draw the text of a CExtButton vertically?
TX
|
|
Technical Support
|
Jun 16, 2006 - 12:53 PM
|
At the moment the vertical text is not supported in CExtButton. But you can override the CExtButton::_RenderImpl virtual method and paint the button text yourself.
|
|
steven frierdich
|
Jun 15, 2006 - 5:15 PM
|
Is there any simple way to add a png picture tool a toolbar button and also a menu item? Any source code to how to do this?
|
|
Technical Support
|
Jun 17, 2006 - 11:10 AM
|
You cannot add a PNG image to a toolbar button or a menu item directly. Here are two ways to workaround this issue.
1. Use some image editor to convert a PNG image to a 32-bit bitmap with alpha channel. After that you can use it as an ordinary bitmap. The CExtToolControlBar::LoadToolBar() method supports loading of 32-bit bitmaps and the CExtCmdManager::UpdateFromToolBar() method allows you to update the command manager with 32-bit toolbar images. This approach is used in the FunnyBars sample. The Vista Icons toolbar and Vista Icons menu demonstrate how 32-bit images can be used in toolbars and menus.
2. Use the ProfSkin library, which allows you to directly load images of PNG format. Please note that the ProfSkin library depends on the LibPNG and Zlib libraries, which included into the Prof-UIS workspace. So before compiling the ProfSkin library, please compile these libraries first. The ProfSkin library uses a CExtSkinBitmap class which implements API for loading/saving images of PNG format. So, you can simply use the CExtSkinBitmap class for loding PNG images directly in this case.
|
|
steven frierdich
|
Jun 15, 2006 - 11:48 AM
|
Ok how much more easy quetion can i ask how to you change tooltips for toolbar and menu so they are balloon tooltips?
|
|
Technical Support
|
Jun 15, 2006 - 12:08 PM
|
You need to override the CExtControlBar::OnAdvancedPopupMenuTipWndDisplay() method in this way: void CYourToolbar::OnAdvancedPopupMenuTipWndDisplay(
CExtPopupMenuTipWnd & _ATTW,
const RECT & rcExcludeArea,
__EXT_MFC_SAFE_LPCTSTR strTipText
) const
{
ASSERT_VALID( this );
ASSERT( strTipText != NULL && _tcslen( strTipText ) > 0 );
_ATTW.SetTipStyle( CExtPopupMenuTipWnd::__ETS_BALLOON );
_ATTW.SetText( strTipText );
_ATTW.Show( (CWnd*)this, rcExcludeArea );
}
|
|
steven frierdich
|
Jun 15, 2006 - 12:23 PM
|
THANK YOU. NICE AND EASY PASTE CODE
|
|
Raphael Gruaz
|
Jun 15, 2006 - 4:27 AM
|
Hi,
I am trying to use a CExtGridWnd. I need to allow my users to add, remove and insert rows and columns. All the cells are text based, and all must be editable
while it works quite well when adding or removing, all the inserted cells are read only. the only exception is the header cell when i insert columns. I used exactly the same code to add and to insert, but adding will create editable cells, unlike inserting.
does anyone have an idea about this?
regards, Raph
|
|
Technical Support
|
Jun 15, 2006 - 7:36 AM
|
We need to take a look at your code so that we can find out what is wrong. You can send us either a piece of code or the entire project.
Please note that to make the cell editable, you need to remove the __EGCS_READ_ONLY and __EGCS_NO_INPLACE_CONTROL cell styles. Of course, the grid should have the __EGWS_BSE_EDIT_CELLS_INNER style applied.
|
|
Raphael Gruaz
|
Jun 15, 2006 - 7:38 AM
|
thanks. Actually, I could solve my problem.
|
|
Massimo Germi
|
Jun 15, 2006 - 3:10 AM
|
1) In OnPaint method, of CForm view derived class, I have g_PaintManager->PaintDocumentClientAreaBkgnd( dcPaint, this ), the windows in not paint correctly when I scroll it.
2) I have inserted CTreeCtrl derived class in CExtControlBar, I’m not able to display icon and, when I compile in release, I don’t see mouse during movement.
Coult you have any suggestions?
tx a lot
|
|
Technical Support
|
Jun 15, 2006 - 5:34 AM
|
1) The g_PaintManager->PaintDocumentClientAreaBkgnd() method doesn’t support scrolling.
2) It is not completely clear what the problem is. Which icon is not displayed? Would you send us some screenshot(s) or a test project?
|
|
Massimo Germi
|
Jun 16, 2006 - 2:23 AM
|
HI, I solved the problem about icon in CTreeCtrl, was my problem.
The problem of the mouse persist and I not understand why. I’m using VC8 - ProfUIS 2.5.4. I have a CTreeCtrl*** inside of CExtControlBar. If I start my exe inside of VC, the mouse is display correctly (when is over CTreeCtrl), indipendently if I compile in Debug or in Release. If I start the program outside af VC (double click on exe icon), the mouse in not displayed when is over CTreeCtrl. Have you experience of similar error in ProfUIS? Unfortunately I cannot send you my proyect because is very big and it has integration with database and other object.
*** I have created CTreeCtrl as a child window of CWnd derived class, this class is created as child of CExtControlBar.
I appreciate any help.
Tx a lot
|
|
Technical Support
|
Jun 16, 2006 - 12:55 PM
|
No, we have never encountered the similar problems before and no our customers reported about these problems. We have several samples in Prof-UIS and they are working correctly. Would you try to create a small project and reproduce the problem?
|
|
Massimo Germi
|
Jun 15, 2006 - 7:56 AM
|
I seen g_PaintManager->PaintDocumentClientAreaBkgnd() method doesn’t support scrolling. There is a method I can use to implement it?
tx
|
|
Technical Support
|
Jun 15, 2006 - 12:06 PM
|
All the background painting methods in all paint managers were designed for painting non-scrollable content. So, you should do the following: 1) Redraw your view window when you receive the WM_HSCROLL and WM_VSCROLL messages. 2) Handle the WM_PAINT message and invoke the paint manager for painting the background like you need. 3) In the the WM_PAINT message handler, invoke the dc.SetViewPortOrg( 0, 0 ) code before calling the paint manager’s API.
|
|
John Kiernan
|
Jun 14, 2006 - 12:31 PM
|
Hi, I’m using a CExtStatusControlBar status bar and the Office 2007 (Luna-Blue) theme. The gradient on the first pane ("Ready" text) is a light blue and all the other panes have a dark blue gradient.
Is there a way to make the rest of the panes have the same gradient as the first pane?
Thanks,
John Kiernan
|
|
Technical Support
|
Jun 14, 2006 - 1:03 PM
|
Yes, you can set any of two backgrounds for the status pane when Office 2007 themes are applied. All the supported status pane backgrounds are defined by the CExtStatusControlBar::e_StatusPaneBackgroundAccent_t enumeration: enum e_StatusPaneBackgroundAccent_t
{
__ESPBA_AUTOMATIC = 0,
__ESPBA_LIGHT = 1,
__ESPBA_DARK = 2,
}; By default, the __ESPBA_AUTOMATIC color accent is used for all the panes. The status tip pane with zero identifer uses the light accent. All other panes use the dark accent. You can get the number of status panes and get/set color accents to each of them using the following members of the CExtStatusControlBar class: int GetPaneCount() const;
virtual e_StatusPaneBackgroundAccent_t OnQueryPaneBackgroundAccent(
int nIndex
) const;
e_StatusPaneBackgroundAccent_t GetPaneBackgroundAccent(
int nIndex
) const;
|
|
John Kiernan
|
Aug 15, 2006 - 4:27 PM
|
Alright, now I have a related question. I just made my dialog resizable and now the gripper on the status bar has a dark accent. Is there a way to change the gripper background accent to be light also?
|
|
Technical Support
|
Aug 16, 2006 - 10:23 AM
|
Thank you for the interesting question. We would like to ask you to update the source code for the CExtPaintManagerOffice2007_Impl::StatusBar_EraseBackground() method in the ../Prof-UIS/Src/ExtPaintManager.cpp file. This update will make the gripper consistent with the background style of the last status pane: bool CExtPaintManagerOffice2007_Impl::StatusBar_EraseBackground(
CDC & dc,
const RECT & rcClient,
const CExtStatusControlBar * pStatusBar,
LPARAM lParam
) const
{
ASSERT_VALID( this );
ASSERT_VALID( pStatusBar );
lParam;
if( m_bmpStatusBkLight.IsEmpty()
|| m_bmpStatusBkDark.IsEmpty()
)
return false;
bool bLastIsDark = true;
INT nPaneIdx, nPaneCount = pStatusBar->GetPaneCount();
if( nPaneCount > 0 )
{
CExtStatusControlBar::e_StatusPaneBackgroundAccent_t eSPBA =
pStatusBar->OnQueryPaneBackgroundAccent( nPaneCount - 1 );
if( eSPBA == CExtStatusControlBar::__ESPBA_LIGHT )
bLastIsDark = false;
}
if( bLastIsDark )
m_bmpStatusBkDark.DrawSkinParts(
dc.m_hDC,
rcClient,
m_rcStatusBkPadding,
CExtBitmap::__EDM_STRETCH
);
else
m_bmpStatusBkLight.DrawSkinParts(
dc.m_hDC,
rcClient,
m_rcStatusBkPadding,
CExtBitmap::__EDM_STRETCH
);
for( nPaneIdx = 0; nPaneIdx < nPaneCount; nPaneIdx++ )
{
CExtStatusControlBar::e_StatusPaneBackgroundAccent_t eSPBA =
pStatusBar->OnQueryPaneBackgroundAccent( nPaneIdx );
if( bLastIsDark )
{
if( eSPBA == CExtStatusControlBar::__ESPBA_LIGHT )
{
CRect rcPane;
pStatusBar->GetItemRect( nPaneIdx, &rcPane );
rcPane.top = rcClient.top;
rcPane.bottom = rcClient.bottom;
if( rcPane.IsRectEmpty() || (! dc.RectVisible( &rcPane ) ) )
continue;
m_bmpStatusBkLight.DrawSkinParts(
dc.m_hDC,
rcPane,
m_rcStatusBkPadding,
CExtBitmap::__EDM_STRETCH
);
continue;
}
}
else
{
if( eSPBA == CExtStatusControlBar::__ESPBA_DARK )
{
CRect rcPane;
pStatusBar->GetItemRect( nPaneIdx, &rcPane );
rcPane.top = rcClient.top;
rcPane.bottom = rcClient.bottom;
if( rcPane.IsRectEmpty() || (! dc.RectVisible( &rcPane ) ) )
continue;
m_bmpStatusBkDark.DrawSkinParts(
dc.m_hDC,
rcPane,
m_rcStatusBkPadding,
CExtBitmap::__EDM_STRETCH
);
continue;
}
}
}
return true;
}
|
|
John Kiernan
|
Aug 16, 2006 - 3:09 PM
|
Excellent. Works great! Thank you very much for your time.
John
|
|
John Kiernan
|
Jun 14, 2006 - 2:02 PM
|
Excellent! Thanks for you help!
|
|
steven frierdich
|
Jun 14, 2006 - 11:42 AM
|
THERE SHOULD BE A METHOD TO CALL TO CHANGE THE TOOLBAR BACKGROUND
|
|
Technical Support
|
Jun 14, 2006 - 1:22 PM
|
Prof-UIS supports 9 built-in UI themes and skins. There is little point in using the term "background color for toolbar" independently from other ui elements. Although you can colorize some controls for some theme (e.g. as it is shown in the ThemeColorizer sample), it is not possible to colorize the toolbar universally for any given theme unless you paint the toolbar window’s background manually yourself.
|
|
Technical Support
|
Jun 14, 2006 - 1:11 PM
|
The ThemeColorizer sample demonstrates how to customize the appearance of the app. Please describe which UI theme are you using and how exactly pixel-by-pixel the toolbar should look?
|
|
steven frierdich
|
Jun 14, 2006 - 11:40 AM
|
If a right mouse click is applied to a button on the toolbar derived from CExtToolControlBar a popmenu appear, how does on disable that.
|
|
Technical Support
|
Jun 14, 2006 - 1:06 PM
|
Have you received our reply with the project attached by e-mail? We described how to remove and/or modify any built-in Prof-UIS menu in it.
|
|
steven frierdich
|
Jun 14, 2006 - 1:29 PM
|
THE CODE YOU SENT NEVER WORKED , IF I APPLY A RIGHT MOUSE CLICK ON A TOOLBAR BUTTON THE POP UP MENU APPEARS
|
|
Technical Support
|
Jun 15, 2006 - 5:42 AM
|
|
|
YS Jang
|
Jun 14, 2006 - 5:06 AM
|
Hi,
I want a Toolbar that is not Dock.
and, I used Funny bar in your library version 2.50
But, I have a Problem,
Sometimes, Toolbar is hide and display back color
=========================================== File view ........................... ----------------------------------------------------------------------------- (toolbar) -> Black color ----------------------------------------------------------------------------- view ----------------------------------------------------------------------------
What is wrong?
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
HICON hIcon = (::AfxGetApp())->LoadIcon(IDR_MAINFRAME);
ASSERT( hIcon != NULL );
SetIcon( hIcon, TRUE );
SetIcon( hIcon, FALSE );
CCreateContext _cc;
_cc.m_pCurrentDoc = NULL;
_cc.m_pCurrentFrame = this;
_cc.m_pLastView = NULL;
_cc.m_pNewDocTemplate = NULL;
_cc.m_pNewViewClass = RUNTIME_CLASS( CChildView );
CWnd * pWndView = CreateView( &_cc );
if( pWndView == NULL )
{
TRACE0("Failed to create view window\n");
return -1;
}
ASSERT_KINDOF( CChildView, pWndView );
m_pWndView =
STATIC_DOWNCAST( CChildView, pWndView );
SetActiveView( m_pWndView );
m_pWndView->ModifyStyleEx( WS_EX_CLIENTEDGE|WS_EX_STATICEDGE|WS_EX_DLGMODALFRAME, 0, SWP_FRAMECHANGED );
CWinApp * pApp = ::AfxGetApp();
ASSERT( pApp != NULL );
ASSERT( pApp->m_pszRegistryKey != NULL );
ASSERT( pApp->m_pszRegistryKey[0] != _T(’\0’) );
ASSERT( pApp->m_pszProfileName != NULL );
ASSERT( pApp->m_pszProfileName[0] != _T(’\0’) );
ASSERT( pApp->m_pszProfileName != NULL );
g_CmdManager->ProfileSetup(pApp->m_pszProfileName, GetSafeHwnd());
VERIFY( g_CmdManager->UpdateFromMenu( pApp->m_pszProfileName,IDR_MAINFRAME));
VERIFY( g_CmdManager->UpdateFromToolBar(pApp->m_pszProfileName,IDR_MAIN_TOOLBAR));//IDR_MAIN_TOOLBAR
if( !m_wndMenuBar.Create(NULL, this,IDR_MAINFRAME))
{
TRACE0("Failed to create menubar\n");
return -1; // failed to create
}
if( (! m_wndToolBar.Create(_T(""), this, IDR_MAIN_TOOLBAR))
|| (! m_wndToolBar.LoadToolBar(IDR_MAIN_TOOLBAR) ) )
{
TRACE0("Failed to create main toolbar\n");
return -1; // fail to create
}
|
|
Technical Support
|
Jun 14, 2006 - 9:50 AM
|
To make the toolbar non-dockable like the status bar, just do not call the EnableDocking() method of this toolbar. You should not also invoke the CFrameWnd::DockControlBar() method for it. The non-dockable toolbar will occupy an entire row/column in the main frame window just as the status bar does. The background of this toolbar will be consistent with the theme provided by the currently used paint manager. You should not see any black background in any case. The black background is provided by the CExtPainManagerOffice2007_R2_Obsidian paint manager, but it is available only with Prof-UIS 2.54. We need more details about the problem. Would you send us your project or a compiled version of your application?
|
|
Offer Har
|
Jun 13, 2006 - 5:33 AM
|
Hi,
I have noticed that each time that a sub-menu is opened (even of the menu bar - a top level menu), a thread is created and exits. Why is this? how can I remove this?
I had some weird hang-ups when opening menus in my application, which is heavily multi-threaded, and i think it has to do with this thread.
Thanks.
|
|
Technical Support
|
Jun 13, 2006 - 10:42 AM
|
|
|
Offer Har
|
Jun 13, 2006 - 11:12 AM
|
Use the SND_ASYNC flag, for example:
PlaySound("MailBeep", NULL, SND_ALIAS|SND_ASYNC);
This should remove the need to create a thread.
|
|
Technical Support
|
Jun 13, 2006 - 12:27 PM
|
There reason for using threads was that there is some delay before the sound actually starts playing. So using threads is justified.
|
|
Emil Pop
|
Jun 12, 2006 - 7:38 PM
|
For consistency reasons, in my project I need to create icons from bitmaps found in toolbars. A couple of years ago, you helped me with the following function:
int iGetIconFromToolbar( int iToolbarId, int iBitmapIx, CExtCmdIcon& rIcon) { // Recover the bitmap list HBITMAP hBmp = CExtPaintManager::stat_LoadBitmapResource( MAKEINTRESOURCE( iToolbarId ) );
ASSERT( hBmp != NULL ); BITMAP bmpInfo; ::memset( &bmpInfo, 0, sizeof(BITMAP) ); ::GetObject( hBmp, sizeof(BITMAP), &bmpInfo ); ASSERT( bmpInfo.bmWidth > 0 && bmpInfo.bmHeight > 0 );
INT i = iBitmapIx; CRect rcPart( 16*i, 0, 16*(i+1), bmpInfo.bmHeight );
// original version // rIcon = CExtCmdIcon ( hBmp, RGB(0,255,0), &rcPart );
// new version
rIcon.AssignFromHBITMAP( hBmp, RGB(192,192,192), // COLORREF(-1L) - no force transparent pixels &rcPart );
ASSERT( !rIcon.IsEmpty() ); ::DeleteObject( hBmp ); return 0; }
While upgrading to Professional Studio 2.54 I noticed some interface changes in CExtCmdIcon (e.g. there was no constructor taking a bitmap as an argument; I used instead the member function CExtCmdIcon::AssignFromHBITMAP() ). In the new implementation though, the background is transparent only if the color quality of the display is 32 bit. Whenever the color quality of the display is 16 bit, the icon’s background is no longer transparent. This is an issue if the application is run through Windows Remote Desktop where the color quality of the display is 16 bit.
I sent you a modified version of the file MainFrm.cpp belonging to the project PageNavigator. Rebuilt the project with it and run it twice: - first set Display/Settings/Color quality to 32 bit everything; notice the question mark associated to the E-mail button has a transparent background (as it should) - stop the application and change Display/Settings/Color quality to 16 bit. - rerun PageNavigator: you’ll notice the background of the E-mail button is no longer transparent...
Thanks, Emil
|
|
Technical Support
|
Jun 13, 2006 - 12:09 PM
|
The function that loads icons works well. The problem is in the API of the page navigator which does not provide method overloads with CExtCmdIcon parameters instead of HICON ’s (Of course, we will add these overloads). This can be fixed in the MainFrm.cpp file you sent us by adding two lines of code: CExtPageNavigatorWnd::PAGE_ITEM_INFO * pPII =
m_wndPageNavigator.ItemInsert(
-1,
_T("Mail"),
oIcon.ExtractHICON(),
oIcon.ExtractHICON()
);
(*(pPII->IconGetPtr(true))) = oIcon; // ADDED
(*(pPII->IconGetPtr(false))) = oIcon; // ADDED The CExtCmdIcon class was not changed, it was actually re-writted from scratch :-). Now all the bitmap re-lated internals of Prof-UIS are 32-bit with alpha channel on any Windows OS even if it does not support alpha blended bitmap painting. The CExtCmdIcon class is now just a container for four CExtBitmap objects which represent normal ( CExtCmdIcon::m_bmpNormal ), hovered ( CExtCmdIcon::m_bmpHover ), pressed ( CExtCmdIcon::m_bmpPressed ) and disabled ( CExtCmdIcon::m_bmpDisabled ) states of the icon. It is enough to initialize only the CExtCmdIcon::m_bmpNormal bitmap inside a CExtCmdIcon object. All other bitmaps will be generated by the paint manager automatically when they are painted anywhere. Both CExtCmdIcon and CExtBitmap classes do not eat GDI handles at all.
|
|
Ramesh Sojitra
|
Jun 12, 2006 - 6:06 AM
|
Sir,
We purchase your Frame Features control. We have our account on your site as ‘scanpoint’ user name. We downloaded frame Features control full setup by using our account. But we can not get Activation key. When we try to access key on your web site some error message come. ( “Temporarily Unavailable Resource” , “ Sorry! Resource you requested is temporarily unavailable.”, “Our technical staff will fix it as soon as possible. We apologize for any inconvenience and thank you for your patience.”)
We required activation for complete setup and start our work. So please send activation key as soon as possible.
Ramesh Sojitra Scanpoint Graphics Ltd. INDIA
|
|
Technical Support
|
Jun 12, 2006 - 7:46 AM
|
We are sorry for any inconvenience caused by this problem with our website. We just contacted our hosting provider and they are working on the problem. We sent you the ctivation key by e-mail. To activate the product, just use your username in all capitals and this key.
|
|
steven frierdich
|
Jun 10, 2006 - 6:50 PM
|
I AM USING THE CExtToolControlBar FOR A TOOLBAR AND I NEED TO CHANGE THE BACKGROUND OF JUST THE TOOLBAR ON THE FLY. ANYONE GOT THE CODE TO DO THIS
|
|
Technical Support
|
Jun 12, 2006 - 12:29 PM
|
You can do this by overriding these two toolbar’s virtual methods: virtual void DoPaintNC( CDC * pDC );
virtual void DoEraseBk( CDC * pDC ); The first paints toolbar’s borders and the second paints the area under toolbar buttons.
|
|
steven frierdich
|
Jun 10, 2006 - 4:28 PM
|
Geeze here is another pas one has to search How does one get the state of a button on a toolbar derived from CExtControlBar since CExtControlBar is not derived from CToolbar?
|
|
Technical Support
|
Jun 12, 2006 - 12:49 PM
|
There are several ways to do this.
For example, you can use the CExtToolControlBar::GetButtonInfo method, which returns both the toolbar button’s command identifier and style: UINT nID = 0;
UINT nStyle = 0;
m_wndToolBar.GetButtonInfo( 0, nID, nStyle ); You can also retrieve the CExtBarButton object and then invoke the CExtBarButton::GetStyle() method: CExtBarButton * pTBB = _GetButtonPtr( nBtnIdx );
ASSERT_VALID( pTBB );
UINT nStyle = pTBB->GetStyle(); The style can be a combination of the TBBS_xxx values which are described in MSDN.
|