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 |
|
Suhai Gyorgy
|
Jul 30, 2007 - 8:48 AM
|
Dear Support,
I tried to change the color of the grid lines in my reportgrid by overriding OnGbwQueryGridLinesColor virtual method. But it never gets called. Even if I put a breakpoint in CExtGridBaseWnd::OnGbwQueryGridLinesColor() , it doesn’t step into that call (I checked if this method is overriden in any of your classes, but it doesn’t seem to be overriden).
If I’m not mistaken, the gridlines are drawn in CExtReportGridWnd::OnGbwPaintCell method, with the FillRect call in this part of code: ...
if( GridLinesHorzGet()
&& hTreeItem != NULL
&& nChildCount == 0L
)
{
COLORREF clrFace = OnSiwGetSysColor( COLOR_3DFACE );
dc.FillSolidRect(
rcCell.left,
rcCellExtra.bottom-1,
rcCell.right - rcCell.left,
1,
clrFace
);
...
}
...
I think clrFace should be taken from OnGbwQueryGridLinesColor , right? (It returns the same color in the default implementation.) Thank you!
|
|
Technical Support
|
Jul 30, 2007 - 10:30 AM
|
Yes, you are absolutely right. Please replace COLORREF clrFace = OnSiwGetSysColor( COLOR_3DFACE ); code with COLORREF clrFace = OnGbwQueryGridLinesColor(); in the ../Prof-UIS/Src/ExtReportGrid.cpp file.
|
|
tera t
|
Jul 30, 2007 - 2:23 AM
|
Hello
The button which is included in the Caption inside I want to acquire the size. ttp://profuis0.tripod.com/20070730/image01.jpg
I use SM_CXSIZE However, I cannot acquire it well Size is too big.
Besides, if there is a good method, please teach it
|
|
Technical Support
|
Jul 30, 2007 - 4:21 AM
|
On Windows XP/Vista you should use the GetThemeInt() API to get the metrics of a particular skinned UI item.
|
|
tera t
|
Jul 30, 2007 - 7:59 PM
|
Hello
I do not understand how to use well. I cannot acquire size well. Please teach it
BOOL CMuResizableDialog::OnInitDialog() { VERIFY( CExtNCW < CExtResizableDialog >::OnInitDialog() );
g_PaintManager.m_UxTheme.OpenThemeData( this->m_hWnd, VSCLASS_WINDOW );
int iVal=-1; g_PaintManager.m_UxTheme. GetThemeInt( WP_MAXBUTTON , 0 , TMT_WIDTH , &iVal );
return TRUE; // return TRUE unless you set the focus to a control }
|
|
Technical Support
|
Jul 31, 2007 - 9:00 AM
|
The following method computes the desired size on Windows XP and should work on Vista: HRESULT hr;
HANDLE hTheme = g_PaintManager.m_UxTheme.OpenThemeData( m_hWnd, VSCLASS_WINDOW );
ASSERT( hTheme != NULL );
SIZE sizeVal = { 0, 0 };
CWindowDC dc( this );
hr = g_PaintManager.m_UxTheme.GetThemePartSize( dc, WP_MAXBUTTON, SBS_NORMAL, NULL, CExtUxTheme::__EXT_UX_TS_TRUE, &sizeVal );
ASSERT( hr == S_OK );
dc.DeleteDC();
g_PaintManager.m_UxTheme.CloseThemeData(); On Vista, Microsoft forums recommend to use the new WM_GETTITLEBARINFOEX message.
|
|
tera t
|
Aug 1, 2007 - 12:34 AM
|
Hello.
Windows 2000, NT Should I use the following orders?
SM_CXSIZE SM_CYSIZE
|
|
Technical Support
|
Aug 1, 2007 - 11:25 AM
|
Yes, you should use them on older Windows OS versions.
|
|
Ed Kennedy
|
Jul 29, 2007 - 7:17 PM
|
Is there a way to determine if the app has a skin loaded and which skin?
Thanks,
ed
|
|
Technical Support
|
Jul 30, 2007 - 4:00 AM
|
Yes, you can determine which paint manager is loaded by using the g_PaintManager.GetPaintManagerName() API or by its run time class. If your application is skinnable (i.e. you are using the ProfSkinPainter paint manager), it is not not possible to determine which skin file is loaded nor it is possible to determine which kind of skin was loaded (binary or XML).
|
|
Suhai Gyorgy
|
Jul 30, 2007 - 1:54 AM
|
Support’s answer to a similar question:
<<<<<<<<<<<<<<<<<< You can do this with g_PaintManager.GetPaintManagerName() , which returns a name of the current paint manager. The returned value is of the CExtPaintManager::e_paint_manager_name_t enumeration type: <pre><code>enum e_paint_manager_name_t { Office2000 = 29901, OfficeXP = 29902, Office2003 = 29903, Office2003NoThemes = 29904, Studio2005 = 29905, NativeXP = 29906, Office2007_R1 = 29907, Office2007_R2_LunaBlue = 29908, Office2007_R2_Obsidian = 29909, Office2007_R2_Silver = 29910, Office2007_R3_LunaBlue = 29911, Office2007_R3_Obsidian = 29912, Office2007_R3_Silver = 29913, ProfSkinPainter = 29914, }; >>>>>>>>>>>>>>>>>> This enumeration could have new members since then, check out in the source code.
|
|
Pierre MEDART
|
Jul 27, 2007 - 11:40 AM
|
Hi,
I’d like to use a font different from Arial in the menu, tabcontrol, toolbars...
How can I do this?
Regards
Pierre
|
|
Technical Support
|
Jul 28, 2007 - 12:01 PM
|
The most Prof-UIS classes use the g_PaintManager->m_FontNormal font stored in the global paint manager. This allows you to easily change the entire GUI font (see the FunnyBar sample for details). For some Prof-UIS controls you can assign a custom font by using the SetFont() method.
|
|
Rado Manzela
|
Jul 27, 2007 - 7:47 AM
|
I have CExtTreeGridWnd - derived view in my aplication. I’ve implemented sorting based on columns using recursive function which orders all items in tree by given column. The problem is that it seems to be very inefficient although when only one item has changed since last sort (also when no item is changed, only direction is reversed). I have about 200 main items, each containing few children. Sorting takes about 0.5 second which is too much because I need real-time sorting while some worker threads are updating some items and when I turn sorting on, CPU is going to 100% and program is practically unresponsible and very slow.
Do you have any idea how to make it faster?
This is what I do now: when worker updates data, it sends message to main thread which updates the tree grid and sorts the tree:
void UpdateTree() { CExtGridDataSortOrder so; bool sorted = m_wndView.GridSortOrderGet(false,so);
.... UPDATE THE TREE (always 1 item)
if (sorted && !so.IsEmpty()) { m_wndView.GridSortOrderSetup(false,so,false,false,false); }
|
|
Technical Support
|
Jul 28, 2007 - 11:57 AM
|
The tree grid contains expanded/collapsed tree row branches. This requires a row mapping algorithm which makes only expanded row branches visible and scrollable in the tree grid window. The sorting algorithm in the tree grid often requires movement of many collapsed rows within one expanded when swapping of two rows is performed. This is the main reason why sorting in tree grid is slower than it is in the plain grid. Please try sorting only one child level of one parent item when your code modifies only one row cells.
|
|
Rado Manzela
|
Jul 28, 2007 - 12:16 PM
|
I’ve optimized it. If somebody other is interested it seems ItemSortChildren() is not too good for recursive sortig because it is doing the same thing mutiple times.
Here is optimized function (working about 6 times faster for my tree):
void CChildView::SortRecursive(HTREEITEM item, const CExtGridDataSortOrder &_gdso,CExtTreeGridDataProvider & _DP) { CExtTreeGridCellNode * pNode = CExtTreeGridCellNode::FromHTREEITEM( item ); ASSERT_VALID( pNode );
_DP.TreeNodeSortChildren( pNode, _gdso, this ) ;
HTREEITEM sItem;
for (sItem = ItemGetFirstChild(item); sItem; sItem = ItemGetNext(sItem,true,false,false)) { if (ItemGetChildCount(sItem) < 2) continue;
SortRecursive(sItem,_gdso,_DP); } }
I’ve placed OnSwUpdateScrollBars(); after calling recursive sort althoungt I’m not sure if it is necessary (sorting should not change number of visible items in tree, should it?).
|
|
Technical Support
|
Jul 30, 2007 - 4:31 AM
|
The sorting in tree grid is much slower than in the plain grid. Yes, the OnSwUpdateScrollBars() method invocation is not needed after resorting because the number of items in the scrollable range does not chang. But you should invoke this method if you are using variable row heights in your tree grid. In this case, the number of visible rows can be different before and after resorting and, as a result, the size of the thumb button on the vertical scroll bar should also become different. We also recommend you ensure visibility of the focused item after resorting.
|
|
Rado Manzela
|
Jul 27, 2007 - 7:36 AM
|
I’ve tried to switch from 2.70 to 2.80. When I use optimized prof-uis.h from previous version, there is linking error when building MBCS debug DLL in VS 6.0 (LIB compiles but linking with my project does the same error).
Linking... Creating library ..\Bin_600/ProfUIS280md.lib and object ..\Bin_600/ProfUIS280md.exp ExtToolControlBar.obj : error LNK2001: unresolved external symbol "public: virtual class CExtCmdIcon * __thiscall CExtBarCheckBoxButton::GetIconPtr(void)" (?GetIconPtr@CExtBarCheckBoxButton@@UAEPAVCExtCmdIcon@@XZ) ..\Bin_600/ProfUIS280md.dll : fatal error LNK1120: 1 unresolved externals Error executing link.exe.
This is the only difference in .h file:
// trial/commercial features //#define __EXT_MFC_NO_TAB_CTRL //#define __EXT_MFC_NO_TABMDI_CTRL #define __EXT_MFC_NO_TABFLAT_CTRL #define __EXT_MFC_NO_TABBUTTONS_CTRL #define __EXT_MFC_NO_TAB_ONENOTE_CTRL #define __EXT_MFC_NO_TAB_WHIDBEY_CTRL //#define __EXT_MFC_NO_TAB_CONTROLBARS #define __EXT_MFC_NO_TOOLBOX_CTRL #define __EXT_MFC_NO_SHORTCUTLIST_CTRL //#define __EXT_MFC_NO_PAGECONTAINER_CTRL //#define __EXT_MFC_NO_GRIDBASEWND //#define __EXT_MFC_NO_GRIDWND #define __EXT_MFC_NO_IMAGEEDITWND #define __EXT_MFC_NO_COLORPALETTE #define __EXT_MFC_NO_ICONEDITDLG //#define __EXT_MFC_NO_BUILTIN_TEXTFIELD //#define __EXT_MFC_NO_BUILTIN_DATEFIELD #define __EXT_MFC_NO_CUSTOMIZE //#define __EXT_MFC_NO_TAB_PAGECONTAINER_CTRL #define __EXT_MFC_NO_TAB_PAGECONTAINER_FLAT_CTRL #define __EXT_MFC_NO_TAB_PAGECONTAINER_BUTTONS_CTRL #define __EXT_MFC_NO_TAB_PAGECONTAINER_ONENOTE_CTRL #define __EXT_MFC_NO_TAB_PAGECONTAINER_WHIDBEY_CTRL //#define __EXT_MFC_NO_DATE_PICKER //#define __EXT_MFC_NO_DATE_PICKER_POPUP #define __EXT_MFC_NO_PAGE_NAVIGATOR #define __EXT_MFC_NO_UNDO_REDO_POPUP //#define __EXT_MFC_NO_DURATIONWND //#define __EXT_MFC_NO_DATETIMEWND //#define __EXT_MFC_NO_TREEGRIDWND //#define __EXT_MFC_NO_PROPERTYGRIDWND //#define __EXT_MFC_NO_REPORTGRIDWND #define __EXT_MFC_NO_TABBED_TOOLBAR #define __EXT_MFC_NO_TABBED_TOOLBAR_FLAT #define __EXT_MFC_NO_TABBED_TOOLBAR_BUTTONS #define __EXT_MFC_NO_TABBED_TOOLBAR_ONENOTE #define __EXT_MFC_NO_TABBED_TOOLBAR_WHIDBEY #define __EXT_MFC_NO_TASK_PANE #define __EXT_MFC_NO_RIBBON_BAR //#define __EXT_MFC_NO_PRINT
// optional features (you can also exclude some resources in the resource.rc file) #define __EXT_MFC_NO_PROF_UIS_ABOUT_DIALOG #define __EXT_MFC_NO_MDI_WINDOWS_LIST_DIALOG //#define __EXT_MFC_NO_SPLITTER_WND #define __EXT_MFC_NO_DOCK_MARKERS #define __EXT_MFC_NO_EXTCONTENTEXPANDWND_H //#define __EXT_MFC_NO_DYNAMIC_BAR_SITE #define __EXT_MFC_NO_CHECK_LIST //#define __EXT_MFC_NO_SCROLLWND //#define __EXT_MFC_NO_SCROLLITEMWND //#define __EXT_MFC_NO_SPIN //#define __EXT_MFC_NO_STATUSBAR //#define __EXT_MFC_NO_NC_FRAME #define __EXT_MFC_NO_TREE_WND //#define __EXT_MFC_NO_PROGRESS_WND //#define __EXT_MFC_NO_THEME_SWITCHER_TOOLBAR
Thank you
|
|
Technical Support
|
Jul 27, 2007 - 11:57 AM
|
Please find the following code in the ../Prof-UIS/Src/ExtToolControlBar.cpp file: #if (!defined __EXT_MFC_NO_RIBBON_BAR)
CExtCmdIcon * CExtBarCheckBoxButton::GetIconPtr()
{
ASSERT_VALID( this );
return NULL;
} and replace it with CExtCmdIcon * CExtBarCheckBoxButton::GetIconPtr()
{
ASSERT_VALID( this );
return NULL;
}
#if (!defined __EXT_MFC_NO_RIBBON_BAR) That should fix the problem.
|
|
George Freewood
|
Jul 27, 2007 - 6:48 AM
|
Hello,
we are looking for a template for a themed CListCtrl, but couldn’t find one yet in ProfUIS. Isn’t there any?
In case there is none: even though we are aware, that CExtGridWnd could be used as a (themed) replacement for the report view of CListCtrl, this is no actual option for us.
First we also need to use the symbol views of CListCtrl, which don’t seem to be supported by CExtGridWnd and second we have so many CListCtrl objects in our applications and don’t need the extra features of CExtGridWnd there, that it is not economical for us to port all these CListCtrl objects to CExtGridWnd just for making these controls themed. I guess many other ProfUIS users may face similar problems.
Can you provide a solution for this problem?
|
|
Technical Support
|
Jul 28, 2007 - 12:04 PM
|
We have no themed version of CListCtrl at present. It is possible to use themed CExtScrollBar scroll bars with CListCtrl and other common controls as it is demonstrated in the following test project, but we have no idea how to make a skinned background and items in the list control.
|
|
George Freewood
|
Jul 29, 2007 - 11:59 AM
|
Hello,
many thanks for your response.
For us (and perhaps many others, too) it would be sufficient in the first step, if the header control in report view would be themed. Thus my wish should more exactly read "themed header control".
If a themed CHeaderCtrl would be available, then it could be easily combined with a normal CListCtrl by means of subclassing.
I am not sure, what you mean with "skinned background". What else do you think to be necessary here?
|
|
Technical Support
|
Aug 2, 2007 - 2:17 PM
|
Thank you for the feature request, George. We added this to our to TO-DO list.
|
|
George Freewood
|
Jul 27, 2007 - 1:28 AM
|
Hello,
we have encountered a problem with the resource handling of Prof-UIS.
Our applications need to make use of AfxSetResourceHandle(), statically linked Prof-UIS and the possibility to store resources like menus, strings, bitmap and cursors in separate (language dependent) DLLs.
Some of Prof-UIS’s classes, however, bend the separate resource handle set by the application back to the main instance handle (which points to resources stored in the .EXE file). This is done by means of CExtLocalResourceHelper.
Since we cannot change our current approach for many reasons we would appreciate a small extension, with which we can prevent CExtLocalResourceHelper from bending the resource handle.
A possible solution could be the introduction of a global variable (say "bool CExtLocalResourceHelper::g_UseResourceHandle") and program code similar to this:
CExtLocalResourceHelper() : m_hInstPrevResource( NULL ) , m_bFree( true ) { #if (!defined __EXT_PROFUIS_STATIC_LINK) Init( __PROF_UIS_MODULE_NAME ); #else Init(g_UseResourceHandle ? ::AfxGetResourceHandle() : ::AfxGetInstanceHandle() ); #endif // #if (!defined __EXT_PROFUIS_STATIC_LINK) };
Many thanks in advance for any support you can provide here.
|
|
Technical Support
|
Jul 27, 2007 - 11:26 AM
|
We accept your suggestion. Thank you. The new CExtLocalResourceHelper::g_bUseResourceHandle static member does the same as the g_UseResourceHandle variable in your message.
|
|
Michael Clapp
|
Jul 26, 2007 - 3:44 PM
|
Hi.. We have following the steps of adding a WindowProc procedure and adding a WM_PAINT handler in our PropertyPage class, following the code described in the 9/16/2005 CExtResizablePropertyPage question "How to draw something such as rect on a CExtResizablePropertyPage which cannot use OnPaint method. Also, we are using a CExtResizablePropertySheet to hold two CExtResizablePropertyPages.
The method seems to get called initially, however when another page is selected, and then the page is reselected, the WM_PAINT message is not received and our custom painting is not performed. Also when a message dialog is popped up ontop of the property page, and then dismissed, the WM_PAINT message is not received..
|
|
Michael Clapp
|
Jul 27, 2007 - 11:31 AM
|
painting.zip has been emailed which shows the program (switch tabs and notice that the painting does not occur a second time)..
|
|
Technical Support
|
Jul 27, 2007 - 10:58 AM
|
Would you reproduce your painting algorithm in a small test project or in a modified version of the ResizablePropertySheet sample and send it to us?
|
|
Debabrata Mukherjee
|
Jul 26, 2007 - 11:11 AM
|
Hi ,
Does ProfUIS support Tabbed strip overa CExtControlBar? If so, can you give me the details on how to do it.
|
|
Technical Support
|
Jul 26, 2007 - 11:45 AM
|
In the ProfStudio you can find how to add a regular toolbar to a control bar. You can then just replace a regular toolbar with a tabbed toolbar. The latter type of toolbar is demonstrated in the TabbedBars sample. If it is not what you really mean, please let us know.
|
|
Suhai Gyorgy
|
Jul 26, 2007 - 9:08 AM
|
Dear Support,
I’d like to add a feature to our CExtReportGridWnd which I saw in Outlook 2003. There the background is slightly darker in the column by which the grid is sorted (but not grouped). There can only be at most one column like that. I guess I have to override OnGbwQueryBackColor method for this.
1. How can I access the CExtReportGridColumn associated with the given cell in this method? (I know how to get CExtReportGridItem, but that doesn’t give me any information in this case)
2. If I access the CExtReportGridColumn object somehow, should I use CExtReportGridSortOrder::ColumnGetIndexOf method to find out if the grid is sorted by that column or not? I see there’s a CExtReportGridColumn::SortingAscendingGet method, but what does it return if grid is not sorted by that column at all (Help says: "Returns true if the column is sorted in ascending order or false if it is sorted in descending order.")
3. On the other way around, from a CExtReportGridSortOrder object, how can I find out which column is the one (if there’s any) by which the grid is sorted, but not grouped? Is it the last one "in the list of columns by which the report grid is sorted and/or grouped"?
Thank you very much!
|
|
Technical Support
|
Jul 30, 2007 - 9:16 AM
|
We are sorry for the delay with this reply. The nColNo parameter of the CExtGridBaseWnd::OnGbwQueryBackColor() method provides you with the plain active column index. The outer header column at the top of the report grid control returned by the CExtGridWnd::GridCellGetOuterAtTop() method is a CExtReportGridColumn object. You should use the CExtReportGridSortOrder::ColumnGetIndexOf() method to detect whether the report grid is sorted or grouped by the specified column. The CExtReportGridSortOrder::ColumnCountGet() method returns the total number of columns including for grouping and sorting. The CExtReportGridSortOrder::ColumnGroupCountGet() method returns the number of columns for grouping. The report grid control is sorted by both kind of columns, but it is sorted by grouped columns first. So, if you need to highlight the sorted background, then the index returned by the CExtReportGridSortOrder::ColumnGetIndexOf() method should not be negative and should be greater or equal to the value returned by the CExtReportGridSortOrder::ColumnGroupCountGet() method.
|
|
Suhai Gyorgy
|
Jul 30, 2007 - 9:37 AM
|
Thank you, my solution was very close to this, but yours is much safer coding!
|
|
Suhai Gyorgy
|
Jul 30, 2007 - 7:48 AM
|
Never mind, I got this one working. Thank you anyways!
|
|
Suhai Gyorgy
|
Jul 26, 2007 - 8:05 AM
|
Dear Support,
When a reportgrid is grouped by more than one column, the painting of the grid is not right. Your ReportGrid sample has the very same problem. Screenshot
It is not really painting problem, more like the columns should be shifted to the right. Outlook 2003 works that way.
|
|
Technical Support
|
Jul 30, 2007 - 9:26 AM
|
We are sorry for the delay with this reply. We agree the columns with a small width should extend to cover the width of expanded indent area. You can fix this by updating the CExtReportGridWnd::OnGbwAdjustRects() method’s source code (Please not this is not the final solution): void CExtReportGridWnd::OnGbwAdjustRects(
LONG nColNo,
LONG nRowNo,
INT nColType,
INT nRowType,
RECT & rcCellExtraA,
RECT & rcCellA
) const
{
ASSERT_VALID( this );
if( nRowType == 0 && nColType == NULL )
{
HTREEITEM hTreeItem = ItemGetByVisibleRowIndex( nRowNo );
if( hTreeItem != NULL )
{
LONG nChildCount = ItemGetChildCount( hTreeItem );
if( nChildCount == 0 )
return;
}
}
CExtTreeGridWnd::OnGbwAdjustRects(
nColNo,
nRowNo,
nColType,
nRowType,
rcCellExtraA,
rcCellA
);
if( nColType != 0 || nRowType != 0 )
return;
LONG nColFirst = 0, nColLast = 0, nColFirstOffset = 0;
OnGbwQueryVisibleColumnRange(
nColFirst,
nColLast,
nColFirstOffset
);
ASSERT( nColFirst <= nColLast );
if( nColNo != nColFirst )
{
::SetRectEmpty( &rcCellA );
::SetRectEmpty( &rcCellExtraA );
return;
}
CRect rcClient = OnSwGetClientRect();
CSize _sizeTotal = OnSwGetTotalSize();
CPoint _pos = OnSwGetScrollPos();
DWORD dwBseStyleEx = BseGetStyleEx();
DWORD dwScrollTypeH = SiwScrollTypeHGet();
if( dwScrollTypeH == __ESIW_ST_NONE
&& (dwBseStyleEx&__EGBS_BSE_EX_PROPORTIONAL_COLUMN_WIDTHS) != 0
)
{
_sizeTotal.cx = OnSwGetClientRect().Width();
_pos.x = 0;
}
if( _sizeTotal.cx < 0 )
_sizeTotal.cx = 0;
if( _sizeTotal.cy < 0 )
_sizeTotal.cy = 0;
LONG nRight = rcClient.left + _sizeTotal.cx - _pos.x;
rcCellA.right = rcCellExtraA.right = nRight;
if( rcCellA.right < rcCellA.left )
rcCellA.right = rcCellA.left;
if( rcCellExtraA.right < rcCellExtraA.left )
rcCellExtraA.right = rcCellExtraA.left;
}
|
|
Suhai Gyorgy
|
Jul 30, 2007 - 9:35 AM
|
Thank you! Please, indicate this bug fix in version history if final solution comes only with a new version. If it comes with an intermediate version (downloadable from your FTP server), please, when it’s ready, let me know with a post here and I’ll drop you an e-mail for details needed for download.
|
|
Technical Support
|
Jul 30, 2007 - 11:21 AM
|
The provided solution can be assumed as the final one but it simply makes data rows full-row. We guess we need one more mode for data rows: they have an indent, but the first columns become wider and shifted to the current data row indent (this mode was implemented in old MS Outlook versions).
|
|
Brian Horn
|
Jul 26, 2007 - 5:08 AM
|
Hi,
We have two issues - 1. We are using prof-uis2.80. We have created CExtRibbonNodeLabel object. The label is left aligned. In previous version of prof-uis label was center aligned. Can you tell us how to align the label text?
2. It is related to quick access ribbon bar. If we keep adding buttons to quick access bar then after exceeding range control bar(minimize, close, maximize) buttons get disappear and remaining buttons also will not appear in title bar.
You can reply at ayubkhan.pathan@mscsoftware.com
Regards, Ayub
|
|
Chris Anderson
|
Jul 25, 2007 - 10:49 PM
|
Is it possible to use keyboard shortcuts to navigate the individual tab items (pages) of the CExtTabWnd control?
|
|
Chris Anderson
|
Jul 30, 2007 - 9:25 PM
|
if you have a shortcut like this, La&yout, for one of the tab pages then on pressing Alt+y it doesnt invoke that page. If however you rename it as La&Yout then it works and selects the appropriate page.
|
|
Technical Support
|
Jul 31, 2007 - 8:57 AM
|
Thank you for reporting this issue. To fix it, please update the following method’s source code: INT CExtTabWnd::ItemFindByAccessChar(
__EXT_MFC_SAFE_TCHAR chrAccess,
INT nStartIdx, // = -1
BOOL bRestartAt0 // = TRUE
) const
{
ASSERT_VALID( this );
if( chrAccess == _T(’0’) )
return -1;
TCHAR szChar[2] = { chrAccess, _T(’\0’) };
::CharUpper( szChar );
int cAccelSearch = szChar[0];
if( cAccelSearch == _T(’\0’) )
return -1;
LONG nCount = ItemGetCount();
LONG nIdx = ( nStartIdx >= 0L ) ? ( nStartIdx + 1L ) : 0L;
if( nIdx >= nCount && bRestartAt0 )
nIdx = 0L;
for( ; nIdx < nCount; nIdx++ )
{
const TAB_ITEM_INFO * pTII = ItemGet( nIdx );
ASSERT_VALID( pTII );
if( ! pTII->VisibleGet() )
continue;
if( ! pTII->EnabledGet() )
continue;
CExtSafeString str = pTII->TextGet();
if( str.IsEmpty() )
continue;
INT nPos = str.Find( _T("&") );
if( nPos < 0
|| nPos == (str.GetLength() - 1)
)
continue;
++ nPos;
TCHAR szAccel[2] = { str.GetAt( nPos ), _T(’\0’) };
::CharUpper( szAccel );
if( szAccel[0] == _T(’\0’) )
return -1;
if( cAccelSearch == szAccel[0] )
{
if( nStartIdx != nIdx )
return nIdx;
}
} // for( nIdx = nStartIdx; nIdx < nCount; nIdx++ )
if( nStartIdx == 0 )
return -1;
for( nIdx = 0; nIdx<nStartIdx; nIdx++ )
{
const TAB_ITEM_INFO * pTII = ItemGet( nIdx );
ASSERT_VALID( pTII );
if( ! pTII->VisibleGet() )
continue;
if( ! pTII->EnabledGet() )
continue;
CExtSafeString str = pTII->TextGet();
if( str.IsEmpty() )
continue;
INT nPos = str.Find( _T("&") );
if( nPos < 0
|| nPos == (str.GetLength() - 1)
)
continue;
++ nPos;
TCHAR szAccel[2] = { str.GetAt( nPos ), _T(’\0’) };
::CharUpper( szAccel );
if( szAccel[0] == _T(’\0’) )
return -1;
if( cAccelSearch == szAccel[0] )
{
if( nStartIdx != nIdx )
return nIdx;
}
} // for( nIdx = 0; nIdx<nStartIdx; nIdx++ )
return -1;
}
|
|
Chris Anderson
|
Jul 29, 2007 - 11:40 PM
|
This works fine except for the fact that there is bug in CExtTabWnd::ItemFindByAccessChar which doesnt handle lower case keyboard shortcuts correctly.
|
|
Technical Support
|
Jul 30, 2007 - 4:27 AM
|
The code snippet in our previous message is exactly the same as in the tab page container control. Please provide us with more details about what is working incorrectly with lower case keyboard shortcuts? Which language is used in tab items? Which language is selected when the problem occurs?
|
|
Chris Anderson
|
Jul 26, 2007 - 10:36 PM
|
ok I see that you mention the ItemFindByAccessChar method but how do I use it with the CExtTabWnd control?
|
|
Chris Anderson
|
Jul 26, 2007 - 10:29 PM
|
My question was for navigating the pages of the CExtTabWnd control not the CExtTabPageContainerWnd which has this feature. How do I implement the same for CExtTabWnd.
|
|
Technical Support
|
Jul 27, 2007 - 11:01 AM
|
You should pre-translate keyboard messages in your main frame or dialog window using the following code: if( WM_KEYFIRST <= pMsg->message
&& pMsg->message <= WM_KEYLAST
&& ( ! CExtPopupMenuWnd::IsKeyPressed( VK_SHIFT ) )
&& ( ! CExtPopupMenuWnd::IsKeyPressed( VK_CONTROL ) )
&& CExtPopupMenuWnd::IsKeyPressed( VK_MENU )
)
{
CExtTabWnd * pWndTabs = . . .;
if( pWndTabs->GetSafeHwnd() != NULL )
{
UINT nChar = UINT( pMsg->wParam );
ASSERT_VALID( pWndTabs );
BYTE lpKeyState[256];
::GetKeyboardState( lpKeyState );
UINT wScanCode = ::MapVirtualKey( nChar, 0 );
HKL hKeyboardLayout =
::GetKeyboardLayout(
( ::AfxGetThread() ) -> m_nThreadID
);
#if (defined _UNICODE)
TCHAR szChar[2] = { _T(’\0’), _T(’\0’) };
::ToUnicodeEx(
nChar,
wScanCode,
lpKeyState,
szChar, 1,
1,
hKeyboardLayout
);
WORD nMapped = WORD( szChar[0] );
#else
WORD nMapped = 0;
::ToAsciiEx(
nChar,
wScanCode,
lpKeyState,
&nMapped,
1,
hKeyboardLayout
);
#endif
LONG nPrevIdx = pWndTabs->SelectionGet();
LONG nNextIdx =
pWndTabs->ItemFindByAccessChar(
(TCHAR)nMapped,
nPrevIdx
);
if( nNextIdx >= 0 && nNextIdx != nPrevIdx )
{
pWndTabs->SelectionSet( nNextIdx, true, true );
return TRUE;
} // if( nNextIdx >= 0 && nNextIdx != nPrevIdx )
} // if( pWndTabs->GetSafeHwnd() != NULL )
} // if( WM_KEYFIRST <= pMsg->message ...
|
|
Technical Support
|
Jul 26, 2007 - 5:43 AM
|
This feature is available starting from v.2.70. The CExtTabPageContainer::m_bAllowAccelBasedPageSelection allows you to select tabs in tabbed page containers by using keyboard shortcuts. There is also a CExtTabWnd::ItemFindByAccessChar() method, which allows you to get the item by a shortcut character.
|
|
Dave Kymlicka
|
Jul 25, 2007 - 2:20 PM
|
When upgrading to ProfUIS v.280 from v2.33, we notice the upgrade in docking markers: from "triangle arrows", to square windows (with arrows inside), ala VS2005.
Is there a way, at runtime, to be able to switch between all the docking marker styles? We would like to offer our customers the follwing options: 1) disabled (= no docking markers) 2) old-style "triangle" docking markers, as they were in ProfUIS v2.33 3) new style, as we see in ProfUIS v2.80
To explain better using code sample, how could you complete the case for "DOCKING_MARKER_VS2005" ??
switch(eDockingMarkerStyle)
{
case DOCKING_MARKER_VS2005:
// ???? How would you enable these ????
break;
case DOCKING_MARKER_TRIANGLE:
CExtControlBar::g_eResizablePanelDockingType =
CExtControlBar::__RESIZABLE_DOCKING_TYPE_STUDIO_2005;
break;
case DOCKING_MARKER_DISABLED:
//fall-through
default:
// disable docking markers
CExtControlBar::g_eResizablePanelDockingType =
CExtControlBar::__RESIZABLE_DOCKING_TYPE_STUDIO_2003;
break;
}
Examining "\Include\ExtControlBar.h" shows that there isn’t another type declared for these new style markers :-( enum eResizablePanelDockingType_t { __RESIZABLE_DOCKING_TYPE_BY_THEME = -1, __RESIZABLE_DOCKING_TYPE_STUDIO_2003 = 0, __RESIZABLE_DOCKING_TYPE_STUDIO_2005 = 1, __RESIZABLE_DOCKING_TYPE_MIN_VALUE = 0, __RESIZABLE_DOCKING_TYPE_MAX_VALUE = 1, }; Do you have any suggestions how we can offer all 3 options? With thanks, David Kymlicka
|
|
Dave Kymlicka
|
Jul 26, 2007 - 10:16 AM
|
That’s exactly what I was looking for, and works great. :-)
Thanks!
|
|
Technical Support
|
Jul 26, 2007 - 5:58 AM
|
|
|
Ian McIntosh
|
Jul 25, 2007 - 12:55 PM
|
Hi,
I have an app that uses a ribbonbar. The ribbonbar is crashing on initialisation with the following call stack:
> ProfUIS270m.dll!CExtCustomizeSite::OnCreateToolbarButton(CExtToolControlBar * pBar=0x01fa8b50, CExtCustomizeCmdTreeNode * pNodeI=0x01fb7f40, CExtCustomizeCmdTreeNode * pNodeC=0x01fb7f40) Line 8288 C++ ProfUIS270m.dll!CExtRibbonNode::OnRibbonCreateBarButton(CExtRibbonPage * pBar=0x01fa8b50, CExtBarButton * pParentTBB=0x01fce5b0) Line 799 + 0x1a bytes C++ ProfUIS270m.dll!CExtRibbonNode::Ribbon_InitBar(CExtRibbonPage * pBar=0x01fa8b50, CExtBarButton * pParentTBB=0x01fce5b0, bool bInsertThisNode=true) Line 952 + 0x16 bytes C++ ProfUIS270m.dll!CExtRibbonNode::Ribbon_InitBar(CExtRibbonPage * pBar=0x01fa8b50, CExtBarButton * pParentTBB=0x00000000, bool bInsertThisNode=true) Line 969 + 0x14 bytes C++ ProfUIS270m.dll!CExtRibbonNodeTabPage::Ribbon_InitBar(CExtRibbonPage * pBar=0x01fa8b50, CExtBarButton * pParentTBB=0x00000000, bool bInsertThisNode=true) Line 3635 + 0x15 bytes C++ ProfUIS270m.dll!CExtRibbonNodeTabPageCollection::Ribbon_InitBar(CExtRibbonPage * pBar=0x01fa8b50, CExtBarButton * pParentTBB=0x00000000, bool bInsertThisNode=true) Line 3503 + 0x15 bytes C++ ProfUIS270m.dll!CExtRibbonNode::Ribbon_InitBar(CExtRibbonPage * pBar=0x01fa8b50, CExtBarButton * pParentTBB=0x00000000, bool bInsertThisNode=false) Line 969 + 0x14 bytes C++ ProfUIS270m.dll!CExtRibbonBar::SetButtons(CExtCustomizeCmdTreeNode * pNode=0x01fb17e0) Line 15733 C++
The trigger seems to be a call to LoadLibrary to load a dll that happens before anything else. If I take out the LoadLibrary call, it works fine. If I make the dll use ANSI character set it also works, but if the dll uses MBCS it crashes. I have replicated this using a new MFC dll to eliminate any code in the dll as the problem.
Any ideas?
Also, I was going to try to replicate this using the RibbonBar sample, but when I build this in MBCS it crashes. I have built the ribbonBar sample with profUIS v2.70 MBCS. It crashes on start up with this call stack:
> mfc80d.dll!AfxAssertValidObject(const CObject * pOb=0x00000000, const char * lpszFileName=0x0129dddc, int nLine=4609) Line 78 C++ ProfUIS270md.dll!007e9026() [Frames below may be incorrect and/or missing, no symbols loaded for ProfUIS270md.dll] ProfUIS270md.dll!007e9ea0() ProfUIS270md.dll!007e71b7() ProfUIS270md.dll!007e483a() ProfUIS270md.dll!007ebc7e() ProfUIS270md.dll!007e2a27() ProfUIS270md.dll!00728d5f() RibbonBar-md.exe!CMainFrame::OnCreate(tagCREATESTRUCTA * lpCreateStruct=0x0012f5d8) Line 1274 + 0x35 bytes C++ mfc80d.dll!CWnd::OnWndMsg(unsigned int message=1, unsigned int wParam=0, long lParam=1242584, long * pResult=0x0012f2a8) Line 2000 + 0xd bytes C++ mfc80d.dll!CWnd::WindowProc(unsigned int message=1, unsigned int wParam=0, long lParam=1242584) Line 1741 + 0x20 bytes C++ RibbonBar-md.exe!CExtNCW<CFrameWnd>::WindowProc(unsigned int message=1, unsigned int wParam=0, long lParam=1242584) Line 388 + 0x14 bytes C++ mfc80d.dll!AfxCallWndProc(CWnd * pWnd=0x0037b920, HWND__ * hWnd=0x012e1122, unsigned int nMsg=1, unsigned int wParam=0, long lParam=1242584) Line 240 + 0x1c bytes C++ mfc80d.dll!AfxWndProc(HWND__ * hWnd=0x012e1122, unsigned int nMsg=1, unsigned int wParam=0, long lParam=1242584) Line 389 C++ mfc80d.dll!AfxWndProcBase(HWND__ * hWnd=0x012e1122, unsigned int nMsg=1, unsigned int wParam=0, long lParam=1242584) Line 411 + 0x15 bytes C++ user32.dll!7e418734() user32.dll!7e41d05b() user32.dll!7e41b4c0() user32.dll!7e41f9fe() ntdll.dll!7c90eae3() user32.dll!7e41fe13() user32.dll!7e41fdd9() ntdll.dll!7c96e0d4() ntdll.dll!7c96d886() ntdll.dll!7c949d18() ntdll.dll!7c91b686() ntdll.dll!7c926a44() ntdll.dll!7c926abe() ntdll.dll!7c96e0f0() ntdll.dll!7c96e0d4() ntdll.dll!7c926abe() ntdll.dll!7c96cde9() ntdll.dll!7c96e0d4() ntdll.dll!7c926abe() ntdll.dll!7c926abe() ntdll.dll!7c96cde9() ntdll.dll!7c96e0f0() ntdll.dll!7c96e0d4() ntdll.dll!7c9268ad() ntdll.dll!7c91056d() ntdll.dll!7c96e0d4() ntdll.dll!7c94a5d0() ntdll.dll!7c926abe() ntdll.dll!7c9268ad() ntdll.dll!7c91b686() ntdll.dll!7c91b298() ntdll.dll!7c9106eb() ntdll.dll!7c91056d() user32.dll!7e419951() ntdll.dll!7c91b686() ntdll.dll!7c91b298() ntdll.dll!7c9106eb() user32.dll!7e418df1() ntdll.dll!7c926abe() ntdll.dll!7c9268ad() ntdll.dll!7c91056d() user32.dll!7e43ecaa() user32.dll!7e41d4ee() user32.dll!7e42ddad() user32.dll!7e42dd98() user32.dll!7e42dd52() user32.dll!7e42dd5c() ntdll.dll!7c91056d() ntdll.dll!7c9176da() ntdll.dll!7c917786() ntdll.dll!7c9174d9() ntdll.dll!7c917638() kernel32.dll!7c80a661() ntdll.dll!7c910833() user32.dll!7e41fecc() ntdll.dll!7c9106eb() ntdll.dll!7c9175ba() user32.dll!7e41ff66() mfc80d.dll!AfxCtxCreateWindowExA(unsigned long dwExStyle=0, const char * lpClassName=0x001641d8, const char * lpWindowName=0x02337c18, unsigned long dwStyle=114278400, int X=-2147483648, int Y=-2147483648, int nWidth=-2147483648, int nHeight=-2147483648, HWND__ * hWndParent=0x00000000, HMENU__ * hMenu=0x06f70b27, HINSTANCE__ * hInstance=0x00400000, void * lpParam=0x00000000) Line 438 + 0xa1 bytes C++ mfc80d.dll!CWnd::CreateEx(unsigned long dwExStyle=0, const char * lpszClassName=0x001641d8, const char * lpszWindowName=0x02337c18, unsigned long dwStyle=13598720, int x=-2147483648, int y=-2147483648, int nWidth=-2147483648, int nHeight=-2147483648, HWND__ * hWndParent=0x00000000, HMENU__ * nIDorHMenu=0x06f70b27, void * lpParam=0x00000000) Line 694 + 0x35 bytes C++ mfc80d.dll!CFrameWnd::Create(const char * lpszClassName=0x001641d8, const char * lpszWindowName=0x02337c18, unsigned long dwStyle=13598720, const tagRECT & rect={...}, CWnd * pParentWnd=0x00000000, const char * lpszMenuName=0x00000080, unsigned long dwExStyle=0, CCreateContext * pContext=0x00000000) Line 564 + 0x54 bytes C++ mfc80d.dll!CFrameWnd::LoadFrame(unsigned int nIDResource=128, unsigned long dwDefaultStyle=13598720, CWnd * pParentWnd=0x00000000, CCreateContext * pContext=0x00000000) Line 696 + 0x35 bytes C++ RibbonBar-md.exe!CRibbonBarApp::InitInstance() Line 53 + 0x20 bytes C++ mfc80d.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00161f1d, int nCmdShow=1) Line 37 + 0xd bytes C++ RibbonBar-md.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00161f1d, int nCmdShow=1) Line 33 C++ RibbonBar-md.exe!__tmainCRTStartup() Line 589 + 0x35 bytes C RibbonBar-md.exe!WinMainCRTStartup() Line 414 C
|
|
Michael Clapp
|
Jul 25, 2007 - 11:43 AM
|
Our application is based on the FixedSizePanels example, but we are using 2 CExtResizableDialogs. We can get the CExtResizableDialogs to dock, but want to change the positions where they dock from:
+------------------+-------+ | | | | | | | | | | | | +------------------+-------+ | | +---------------------------+
to
+------------------+-------+ | | | | | | | | | | | | +------------------+ | | | | +---------------------------+
Is this possible?
|
|
Michael Clapp
|
Jul 27, 2007 - 12:05 PM
|
CExtPanelControlbar.zip has been emailed..
|
|
Michael Clapp
|
Jul 26, 2007 - 5:18 PM
|
We are able to dock the first CExtPanelControlBar on the right side of the frame using DockControlBar.
When we try to dock the second CExtPanelControlBar on the bottom of the frame using DockControlBar(&m_wndPanelDialog, AFX_IDW_DOCKBAR_BOTTOM,&rect);
(rect is set such that its width is less than the left side of the first docked CExtPanelControlBar)
the second bar seems to stretch to fill the entire bottom row, pushing up the first CExtPanelControlBar which was docked on the right side.
When the second CExtPanelControlBar floats, it seems to be the correct size. How do you prevent the CExtPanelControlBar from changing size when it is docked?
|
|
Technical Support
|
Jul 27, 2007 - 10:59 AM
|
Would you show the entire code which docks all the control bars in your project?
|
|
Technical Support
|
Jul 25, 2007 - 12:35 PM
|
We can guess you are using CExtPanelControlBar -fixed size control bars as containers for your resizable dialogs. The panel bars are docked initially exactly like toolbars. You can read about this here.
|
|
Massimo Germi
|
Jul 25, 2007 - 2:52 AM
|
I need to draw an animation file (.avi) in a prof-uis themed dialog apps. How can I draw a transparent background of .avi to reproduce prof-uis theme ? Alternatively, is there a control, in prof-uis classes, I can use?
Tx a lot
|
|
Technical Support
|
Jul 25, 2007 - 12:48 PM
|
The background of all controls and dialogs is based on bitmaps or gradients, which depend on the current paint manager (theme).
You can paint a valid background compatible with the dialog background and current theme by using the following code: CExtMemoryDC dc(
&dcPaint,
&rcClient
);
// draw themed background
bool bTransparent = false;
if( g_PaintManager->GetCb2DbTransparentMode( this ) )
{
CExtPaintManager::stat_ExcludeChildAreas(
dc,
GetSafeHwnd(),
CExtPaintManager::stat_DefExcludeChildAreaCallback
);
if( g_PaintManager->PaintDockerBkgnd( true, dc, this ) )
bTransparent = true;
}
if( ! bTransparent )
dc.FillSolidRect(
&rcClient,
g_PaintManager->GetColor( CExtPaintManager::CLR_3DFACE_OUT, this )
);
//////////////////////////////////////////////////////////////////////
// PLACE CONTROL PAINTING CODE HERE
////////////////////////////////////////////////////////////////////// Please note Prof-UIS comes with the AviFrames sample where you can see how to read and display avi files.
|
|
Stan Miasnikov
|
Jul 24, 2007 - 5:07 PM
|
When Undo/Redo list box is displayed by clicking on the button in the toolbar the OnPopupUndoRedoFormatCaption is executed as expected, so we can substitute the default caption text. However, it also adds the list box to the corresponding menu item by adding a splitter (I don’t remember seeing it before upgrading to 2.80, is it a new feature?). When this list box is displayed, the OnPopupUndoRedoFormatCaption method is not called, so it always displays the default caption. How can I change the caption in the latter case?
Thanks,
|
|
Technical Support
|
Jul 25, 2007 - 12:54 PM
|
We did not change the behavior of the undo/redo popup list in 2.80. Would you send us some screenshots of this control so we can better understand what the problem is?
|
|
Ian McIntosh
|
Jul 24, 2007 - 11:53 AM
|
Hi, I have a dialog in an autohide bar. If I press a button on it then move my cursor out of the window, it auto hides (as it should). Now if I move my cursor over its tab, the tab highlights but the window is not auto-shown. And if I move the cursor over the tabs of any other hidden windows the same happens. It also does not work if I click the tab. If I select another child window or minimise then restore the app, its all back working again.
|
|
Ian McIntosh
|
Aug 14, 2007 - 9:47 AM
|
Please can you let me know what is happening with this issue
|
|
Ian McIntosh
|
Jul 26, 2007 - 10:01 AM
|
I have sent an e-mail with an attached doc with screenshots
I have added the styles suggested above but it has made no difference.
|
|
Technical Support
|
Jul 25, 2007 - 7:40 AM
|
Please make sure that the WS_CLIPSIBLINGS and WS_CLIPCHILDREN styles are set in the cs.style in the CMainFrame::PreCreateWindow() virtual method. If this does not help, would you reproduce this problem using one of Prof-UIS samples? Or would you send us some screenshots?
|
|