Subject |
Author |
Date |
|
Eric Houvenaghel
|
Jul 26, 2006 - 11:59 AM
|
Hello, I am trying to use the CExtReportGridWnd class in my application. I would like to know if there is a prebuilt filtering system to one can apply on a column of the grid? This would result in hiding the rows that do not meet the filtering critiria.
|
|
Technical Support
|
Jul 27, 2006 - 8:11 AM
|
This feature is not supported in Prof-UIS. We can only regard this as a feature request.
|
|
Suhai Gyorgy
|
Jul 26, 2006 - 9:21 AM
|
Dear Support,
I’m trying to do drag-n-drop in my grid. As I read in General Forum, I have to override the OnGbwDataDndDo method, so I did just that. But since that method never got called, I realized that I also have to override OnGbwDataDndIsAllowed() and return true in it, instead of original return value, which is false. Still OnGbwDataDndDo doesn’t get called. I even tried to override OnGbwDataDndCanStart and return true in that one as well, but still no luck. I checked all grid and cell styles which could affect Dnd, but all DND styles affect dragging of only header (outer) cells.
What am I missing?
Thank you: Chris.
|
|
Technical Support
|
Jul 26, 2006 - 10:08 AM
|
The availabilty of drag-and-drop for data cells is controlled by the following method of the CExtGridBaseWnd class: virtual bool OnGbwDataDndIsAllowed() const; So override this method and return true . This is enough to see how the following methods of the same class are working: virtual CPoint OnGbwDataDndGetStartOffset() const;
virtual bool OnGbwDataDndCanStart(
const CExtGridHitTestInfo & htInfo
);
virtual void OnGbwDataDndDo(
const CExtGridHitTestInfo & htInfo
);
|
|
Suhai Gyorgy
|
Jul 26, 2006 - 11:13 AM
|
As I wrote in my first message, I did override OnGbwDataDndIsAllowed() method and wrote return true in it. I put a breakpoint in the first line of the OnGbwDataDndDo method, but it never stopped there, so OnGbwDataDndDo never gets called. So my question is, why OnGbwDataDndDo doesn’t get called?
Regards: Chris.
|
|
Technical Support
|
Jul 27, 2006 - 9:15 AM
|
We added the following to the declaration of CDemoGrid in the SimpleGrids sample: virtual bool OnGbwDataDndIsAllowed() const
{
return true;
}
virtual void OnGbwDataDndDo(
const CExtGridHitTestInfo & htInfo
)
{
htInfo;
::AfxMessageBox( _T("OnGbwDataDndDo") );
} The message box pop ups when we start dragging selected data cells in any grid in the SimpleGrids sample. Please check whether the method declarations are exactly the same in your project. Additionally, the drag-and-drop for data will not be available if the selection is not allowed at all.
|
|
Suhai Gyorgy
|
Jul 27, 2006 - 12:01 PM
|
The problem was first caused by the Prof-UIS help. I copy/pasted declaration of OnGbwDataDndDo from there and there it looks like this:
virtual void OnGbwDataDndDo(const CExtGridHitTestInfo htInfo );
I didn’t pay enough attention to your first message, didn’t see missing & from before parameter. Sorry, my bad. It works great now, thank you!
Best regards: Chris.
|
|
Technical Support
|
Jul 27, 2006 - 12:26 PM
|
We are really sorry. That is our fault. We fixed this in the help.
|
|
Suhai Gyorgy
|
Jul 26, 2006 - 8:35 AM
|
Dear Support,
In our application we have some items that we show in our Grid filtered. When the filtering changes, we remove all rows from the grid and add the items corresponding to the new filtering. I want the new items to be sorted the same way as before. So my code is:
CExtGridDataSortOrder dsoCurr; m_wndGrid.GridSortOrderGet(false, dsoCurr);
m_wndGrid.RowRemoveAll( false ); //add new rows and fill them m_wndGrid.GridSortOrderSetup(false, dsoCurr);
My problem is that the sorting’s ascending/descending attribute is changing when new filtering happens. I tried to play with the 3rd and 4th parameter of the GridSortOrderSetup method, but either it changed asc/desc, or it didnt do anything (no sorting took place). The affect of m_wndGrid.GridSortOrderSetup(false, dsoCurr); can be checked in the Prof-UIS_Controls Sample, if we initialize the grid with m_wndGrid.BseModifyStyle(__EGWS_BSE_SORT_COLUMNS_T, __EGWS_BSE_DEFAULT); in CPageGrid::OnInitDialog(), add the code:
CExtGridDataSortOrder::ITEM_INFO iInfo; iInfo.m_nRowColNo = 0L; iInfo.m_bAscending = true; CExtGridDataSortOrder dsoCurr; dsoCurr.m_arrItems.Add(iInfo); m_wndGrid.GridSortOrderSetup(false, dsoCurr);
to the end of the same method, and in the CPageGrid::OnTimer we add:
CExtGridDataSortOrder dsoCurr; m_wndGrid.GridSortOrderGet(false, dsoCurr); m_wndGrid.GridSortOrderSetup(false, dsoCurr);
Could you please check this issue? Thank you: Chris
|
|
Technical Support
|
Jul 26, 2006 - 10:05 AM
|
We guess the problem is caused by the following behavior of the CExtGridWnd::GridSortOrderSetup() method: if the specified CExtGridDataSortOrder sort order information is equal to previously applied to the grid window, then the CExtGridWnd::GridSortOrderSetup() method does nothing. If you want to update the existing sort order after any data changes, use the following code: CExtGridWnd & wndGrid = . . .
CExtGridDataProvider & _DataProvider = wndGrid.OnGridQueryDataProvider();
_DataProvider.SortOrderUpdate( true, &wndGrid );
_DataProvider.SortOrderUpdate( false, &wndGrid ); You can also invoke the following lines to keep the focused cell visible: CPoint ptFocus = wndGrid.FocusGet();
if( ptFocus.x >= 0 )
wndGrid.EnsureVisibleColumn( ptFocus.x );
if( ptFocus.y >= 0 )
wndGrid.EnsureVisibleRow( ptFocus.y ); You may also need to know whether your code should install a new grid sort order or update the existing one. The CExtGridWnd::GridSortOrderGet() method allows you to get the installed sort order information. You can compare two CExtGridDataSortOrder sort order information objects using the C++ operator == implemented in the CExtGridDataSortOrder class.
|
|
Suhai Gyorgy
|
Jul 26, 2006 - 11:33 AM
|
As I wrote in my first message, the CExtGridWnd::GridSortOrderSetup() does do something when the sort order specified in the parameter is equal to previously applied to the grid window. So if it wasn’t your intention, please check this issue. Anyway, I’m going to use CExtGridDataProvider::SortOrderUpdate then.
Best regards: Chris.
|
|
Technical Support
|
Jul 27, 2006 - 8:37 AM
|
We just provided more details about sort order. We think you need to invoke only the following code finally after changing grid data: CExtGridWnd & wndGrid = . . .
CExtGridDataProvider & _DataProvider = wndGrid.OnGridQueryDataProvider();
_DataProvider.SortOrderUpdate( true, &wndGrid );
_DataProvider.SortOrderUpdate( false, &wndGrid );
|
|
Suhai Gyorgy
|
Jul 27, 2006 - 8:50 AM
|
Yes, thank you, this code with _DataProvider.SortOrderUpdate( true, &wndGrid ); really does work as needed. I’m not using CExtGridWnd::GridSortOrderSetup() anywhere in my code now.
What I was trying to tell you is this:
In one of your messages above in this thread you wrote: "... If the specified CExtGridDataSortOrder sort order information is equal to previously applied to the grid window, then the CExtGridWnd::GridSortOrderSetup() method does nothing."
In my experiences this is not true. When I tried to use this method earlier (not anymore), it did do something: changed the ascending/descending order. So I’m just trying to tell you about a possible bug. But of course, if I use the code with CExtGridDataProvider::SortOrderUpdate, no problem appears.
Regards: Chris.
|
|
Technical Support
|
Jul 27, 2006 - 11:02 AM
|
We checked this again and cannot confirm that resorting is peformed when the same sort order is applied again.
|
|
David Skok
|
Jul 26, 2006 - 8:16 AM
|
Some data that I display in CextGridWnd columns is integer based however I choose to use CExtGridCellString so that I can display the string that I want to represent the data. The problem is that when I sort, the sort is alphabetically based on character strings and doesn’t make sense for the underlying data. Is it possible for me to alter the underlying compare between CExtGridCellString elements or is a better approach to go to integer cells and change the way they are displayed. If the latter is viable I still need to provide alphanumeric editing capabilities.
PS - Will the updated help be available soon??!!
|
|
David Skok
|
Jul 26, 2006 - 9:54 AM
|
Nevermind, I just found that non-overridable operators use compare which is overridable.
I am still wondering about updated help though :)
Thanks
|
|
Technical Support
|
Jul 26, 2006 - 9:58 AM
|
You should use a CExtGridCellString -derived class, which implements a custom comparison algorithm: class CExtGridCellForDavid : public CExtGridCellString
{
public:
DECLARE_SERIAL( CExtGridCellForDavid );
IMPLEMENT_ExtGridCell_Clone( CExtGridCellForDavid, CExtGridCellString );
CExtGridCellForDavid(
CExtGridDataProvider * pDataProvider = NULL
);
CExtGridCellForDavid( const CExtGridCell & other );
virtual int Compare(
const CExtGridCell & other,
DWORD dwStyleMask = __EGCS_COMPARE_MASK,
DWORD dwStyleExMask = __EGCS_EX_COMPARE_MASK
) const;
}; // class CExtGridCellForDavid
IMPLEMENT_SERIAL( CExtGridCellForDavid, CExtGridCellString, VERSIONABLE_SCHEMA|1 );
CExtGridCellForDavid::CExtGridCellForDavid(
CExtGridDataProvider * pDataProvider // = NULL
)
: CExtGridCellString( pDataProvider )
{
}
CExtGridCellForDavid::CExtGridCellForDavid( const CExtGridCell & other )
: CExtGridCellString( other )
{
}
int CExtGridCellForDavid::Compare(
const CExtGridCell & other,
DWORD dwStyleMask, // = __EGCS_COMPARE_MASK
DWORD dwStyleExMask // = __EGCS_EX_COMPARE_MASK
) const
{
ASSERT_VALID( this );
CExtSafeString sTextLeft, sTextRight;
TextGet( sTextLeft );
other.TextGet( sTextRight );
long lValLeft = sTextLeft.IsEmpty() ? 0L : _ttol( LPCTSTR(sTextLeft) );
long lValRight = sTextRight.IsEmpty() ? 0L : _ttol( LPCTSTR(sTextRight) );
if( lValLeft < lValRight )
return -1;
if( lValLeft > lValRight )
return 1;
return CompareStyleOnly( other, dwStyleMask, dwStyleExMask );
} The updated help wil be available in the next month. P.S. Automatic cell editing feature you requested for all the grid controls today is already implemented. Please contact us by e-mail if you need the update right now.
|
|
Suhai Gyorgy
|
Jul 26, 2006 - 4:08 AM
|
Dear Support,
I tried using SelectionSet to set selection in a CExtGridWnd. For testing purposes I put the following code at the end of CPageGrid::OnInitDialog() of your ProfUIS_Controls Sample (right before return TRUE;):
CRect rectCell; m_wndGrid.GridCellRectsGet(0L, 3L, 0, 0, &rectCell); m_wndGrid.SelectionSet(rectCell); LONG nRowIndex = m_wndGrid.SelectionGetFirstRowInColumn(0L);
My problem is that nRowIndex gets to be -1, even though it should be 3L. Why is that?
Regards: Chris
|
|
Dominic Tioseco
|
Jan 6, 2020 - 10:20 PM
|
Hi, Would you please give me an example on how to use CExtGridWnd::SelectionSet() ? If I have a 4x4 grid, how do I pro grammatically select the second row and first column?
Thanks, Dominic
|
|
Technical Support
|
Jul 26, 2006 - 7:32 AM
|
The source code in your message is not correct. The CExtGridWnd::GridCellRectsGet() method allows you to get the location of a grid cell and the location of any of its parts. The location is specified in pixels of grid window’s client area. The CExtGridWnd::GridCellRectsGet() method returns false if the grid cell is outside the visible range of cells. In this case it is not possible to compute the cell location and you should always analyze the returned boolean value. The CExtGridWnd::SelectionSet() method allows you to change the selection in the grid window. The selection region in the grid is implemented as an array of rectangles. Each rectangle contains zero-based numbers of columns and rows. This selection region based on rectangles is used in the grid window regardless of if the grid is full row, full column or custom range selection oriented. So, the rectangle you specified in the parameters of the CExtGridWnd::SelectionSet() method should contain row/column numbers -- not pixels.
|
|
Suhai Gyorgy
|
Jul 26, 2006 - 8:06 AM
|
Thank you very much! The Help wasn’t very clear on this method and no Sample contained call of CExtGridWnd::SelectionSet(), which could clear it up. I’ll try it this way then.
|
|
Neville Franks
|
Jul 26, 2006 - 2:19 AM
|
Hi, I have a Toolbar with a Combo box and when my CMainFrame::OnTextFieldInplaceTextSet() is called I execute various code. This code does a lot of processing and updates the UI. I run into various obscure and hard to replicate problems depending on the operating system version. My guess is that the PeekMessage() loop in CExtBarTextFieldButton::OnInplaceControlRun() and calls to !AfxGetThread()->PumpMessage() are causing the problems I’m seeing.
One example is your Toolbar code going into an endless loop if I repeatedly press Enter in the Combo say 6 times. I assume it is stuck in CExtBarTextFieldButton::OnInplaceControlRun(). Other problems are crashes.
What I want to do is execute my code after your PeekMessage() and PumpMessage() loops have finished, so they can’t interfere with the normal MFC message loop. I tried using PostMessage() in CMainFrame::OnTextFieldInplaceTextSet() to post a message back to my CMainframe but that doesn’t work as your message loop processes the message I post as well.
Can you please suggest the best way to do this.
Thanks, Neville
|
|
Neville Franks
|
Jul 27, 2006 - 8:41 PM
|
Thanks for the prompt response. Can you please make sure this change is added into your next release.
|
|
Technical Support
|
Jul 26, 2006 - 7:27 AM
|
Thank you for the interesting question. Please find the following code in the CExtBarTextFieldButton::OnInplaceControlRun() method: for( MSG msg; ::IsWindow(hWndCtrl); )
{
// Process all the messages in the message queue
while( PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) )
And replace it with the following code:
for( MSG msg; ::IsWindow(hWndCtrl); )
{
// Process all the messages in the message queue
while(
PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)
&& ::IsWindow(hWndCtrl)
) This should let CExtBarTextFieldButton::OnInplaceControlRun() release its control over thread’s message loop. Additionally we guess this problem should not occur with the same text/combo field placed into a popup menu.
|
|
David Skok
|
Jul 25, 2006 - 9:03 AM
|
I would like to have InPlaceEdit invoked for the first keypress for cells in ExtGridWnd, CExtPropertyGridCtrl and CExtReportGrid controls. The cell contents would immediately be replaced with the letter/symbol of the first keypress. How can I do this?
|
|
Technical Support
|
Jul 26, 2006 - 7:06 AM
|
This feature is not yet supported in the current version but we can regard you message as a feature request for the next version of Prof-UIS. Of course, we could implement it quickly in a test project but we think it would be better if it is available for everyone.
|
|
YS Jang
|
Jul 25, 2006 - 2:14 AM
|
Hi.
I use the CExtMenuControlbar and want to change the text(menu title) of menuitem on runtime.
I have two problems.
1. My Application’s menu text is not changed. (The menu without Command ID is changed. but others are not changed)
CMainFrame::MenuTextChange() { CMenu *pMenu, *pSubMenu;
pMenu = m_wndMenuBar.GetMenu();//CExtMenuControlBar m_wndMenuBar pMenu->ModifyMenu(0, MF_STRING|MF_BYPOSITION, NULL, "Test"); //Good work ...Without Command ID
pSubMenu = pMenu.GetSubMenu(0); pSubMenu->ModifyMenu(0, MF_STRING|MF_BYPOSITION, ID_FILE_EXIT, "Exit"); // The Menu text is not Changed ........ }
2. Some menuitem is changed but the menuitem’s status is diable
How to can I resove? thanks....
pMenu = m_wndMenuBar.GetMenu
|
|
Technical Support
|
Jul 25, 2006 - 7:35 AM
|
You should not use the CExtMenuControlBar::GetMenu() method because it’s for internal purposes only. The menu bar is a kind of toolbar. Its buttons are CExtBarButton objects. You can rebuild its buttons using the CExtMenuControlBar::UpdateMenuBar() method. The latter invokes the CExtMenuControlBar::_UpdateMenuBar() virtual method, which recreates all the CExtBarButton objects representing menu bar’s buttons. So you can create a CExtMenuControlBar -derived class and override its _UpdateMenuBar() virtual method, which should be similar to the original one but you need to use your own algorithm of assigning names to buttons. The article Constructing Menus Dynamically at Run Time may be helpful with this.
|
|
YS Jang
|
Jul 25, 2006 - 5:38 PM
|
thanks.
But I don’t need to create a new menuitem. I just want to change the text of menuitem that is created already. I’m searching your article and CExtPopupMenuWnd’s functions but I didn’t found how to change the text of menu.
|
|
Suhai Gyorgy
|
Jul 26, 2006 - 2:03 AM
|
Hi!
If you know the ID of the command, this is what I’m using:
CExtCmdItem * pCmdItem = g_CmdManager->CmdGetPtr( g_CmdManager->ProfileNameFromWnd(AfxGetMainWnd()->GetSafeHwnd()), _ID_FILE_EXIT ); ASSERT (pCmdItem != NULL );
pCmdItem->m_sMenuText = "Exit"; //pCmdItem->m_sAccelText = "Some accelerator"; //pCmdItem->m_sTipStatus = "Tips appearing in StatusBar"; //pCmdItem->m_sTipTool = "Tips appearing in popup Tooltip";
Regards: Chris
|
|
Technical Support
|
Jul 26, 2006 - 5:30 AM
|
Any menu item in the top level menu line is a CExtBarButton object in the CExtMenuControlBar window. If you want modify some item (or create or remove), you should implement your own CExtMenuControlBar::_UpdateMenuBar() virtual method as we suggested earlier. If you want to modify a menu item somewhere in a pop-up that is invoked from the menu line, then you should handle the CExtPopupMenuWnd::g_nMsgPrepareOneMenuLevel registered windows message, which is sent before any sub menu appears on the screen and allows you to build or change any popup menu. This message should be handled in your main frame window: ON_REGISTERED_MESSAGE(
CExtPopupMenuWnd::g_nMsgPrepareOneMenuLevel,
OnExtMenuPrepare
)
LRESULT CMainFrame::OnExtMenuPrepare(WPARAM wParam, LPARAM lParam)
{
lParam;
CExtPopupMenuWnd::MsgPrepareMenuData_t * pData =
reinterpret_cast
< CExtPopupMenuWnd::MsgPrepareMenuData_t * >
( wParam );
ASSERT( pData != NULL );
CExtPopupMenuWnd * pPopup = pData->m_pPopup;
ASSERT( pPopup != NULL );
// MODIFY pPopup HERE USING CExtPopupMenuWnd METHODS
pData->m_bMenuChanged = true; // invoke this line if menu was changed
return 1;
}
|
|
YS Jang
|
Jul 27, 2006 - 5:58 AM
|
Thanks..
I have tried to change the menu text the way above article. but I didn’t get a result
then.
I found the solution to resolve my problems due to Suhai Gyorgy.... thanks Gyorgy
OK. Is My Coding correct?
void CMainFrame::SetLanguageFile(DWORD dwLanguage) { CString strLanguagePath = _T("");
switch(dwLanguage)
{
case LANGUAGE_ENGLISH:
m_fileOptionLanguage.m_strFileName= "Language\\English.ini";
break;
default:
m_fileOptionLanguage.m_strFileName= "Language\\English.ini";
break;
}
CString strName;
CMenu *pMenu, *pSubMenu; pMenu = m_wndMenuBar.GetMenu(); //CExtMenuControlBar m_wndMenuBar
//File
strName = m_fileOptionLanguage.IniFileReadStringEx("MENU", "ID_MENU_FILE","");
pMenu->ModifyMenu(0, MF_STRING|MF_BYPOSITION, NULL, (LPSTR)(LPCTSTR)strName);
strName = m_fileOptionLanguage.IniFileReadStringEx("MENU","ID_MENU_FILE_EXIT",""); CExtCmdItem * pCmdItem = g_CmdManager->CmdGetPtr( g_CmdManager->ProfileNameFromWnd(AfxGetMainWnd()->GetSafeHwnd(), ID_FILE_EXIT );
ASSERT (pCmdItem != NULL ); pCmdItem->m_sMenuText = strName;
m_wndMenuBar.UpdateMenuBar(); }
|
|
Technical Support
|
Jul 27, 2006 - 9:30 AM
|
No, your code is not correct because you should not use the CExtMenuControlBar::GetMenu() method. The returned CMenu even can be a temporary menu. The CExtMenuControlBar::GetMenu() method is for internal use only. Please follow the advice on how to implement the CExtMenuControlBar::_UpdateMenuBar() virtual method.
|
|
Suhai Gyorgy
|
Jul 27, 2006 - 6:52 AM
|
You should consider using a CExtMenuControlBar-derived class and override CExtMenuControlBar::_UpdateMenuBar() virtual method as Support suggested (I’m myself using this same approach).
Also you should consider to modify top menu items the same way as command items, using CExtCmdItem, especially if you are using customize.
This can be done by this code, if you know that ID_MENU_FILE is on the 0. position:
UINT nCmdId = m_wndMenuBar.GetButton(0)->GetCmdID(); CExtCmdItem *pCmdItem = g_CmdManager->CmdGetPtr( g_CmdManager->ProfileNameFromWnd(AfxGetMainWnd()->GetSafeHwnd()), nCmdId ); ASSERT( pCmdItem != NULL ); pCmdItem->m_sToolbarText = m_fileOptionLanguage.IniFileReadStringEx("MENU", "ID_MENU_FILE","");
Here you have to use m_sToolbarText, because top menu items are really Toolbar buttons showing text instead of icon.
Regards: Chris.
|
|
YS Jang
|
Jul 28, 2006 - 1:16 AM
|
thanks...
Good working!
I added a CMainMenuClass that is a CExtMenuControlBar-derived class and CExtMenuControlBar::_UpdateMenuBar() virtual method as your advice.
CMainMenuBar::_UpdateMenuBar() { CMenu* pMenu = GetMenu(); ..... }
then, The UpdateMenuBar() is called when menu is created.
But, I need to change the text of menu items when I Click the menu item (ex. View->Language->English)
I have changed the my code.
I added a CMainMenuClass that is a CExtMenuControlBar-derived class and CExtToolControlBar::GetButton() and GetButtonMenu() virtual method.
CExtButtonBar* CMainMenuBar :: GetButton(int nIndex) { return CExtToolControlBar::GetButton(nIndex); }
HMENU CMainMenuBar::GetButtonMenu(int nIndex) { return CExtToolControlBar::GetButtonMenu(nIndex); }
Have My code is a problem?
|
|
Suhai Gyorgy
|
Jul 28, 2006 - 2:03 AM
|
In one of your previous messages you had a method called SetLanguageFile. I’m guessing that method is called from the command handler of your View->Language->English command. If you call m_wndMenuBar.UpdateMenuBar() in that SetLanguageFile method, then your overriden CMainMenuBar::_UpdateMenuBar() will get called. In that CMainMenuBar::_UpdateMenuBar() you should somehow get access to your m_fileOptionLanguage variable and use it to do all the modifying of strings.
I don’t think you need to override GetButton and GetButtonMenu methods. CExtMenuControlBar is derived from CExtToolControlBar anyway.
And as support said, do not use GetMenu() at all anywhere in your code.
This is how I can imagine your code:
void CMainFrame::SetLanguageFile(DWORD dwLanguage) { CString strLanguagePath = _T(""); switch(dwLanguage) { case LANGUAGE_ENGLISH: m_fileOptionLanguage.m_strFileName= "Language\\English.ini"; break; default: m_fileOptionLanguage.m_strFileName= "Language\\English.ini"; break; }
// ini file processing, like opening and all
m_wndMenuBar.UpdateMenuBar(); //now CMainMenuBar::_UpdateMenuBar(BOOL bDoRecalcLayout) gets called
//change Exit command string strName = m_fileOptionLanguage.IniFileReadStringEx("MENU","ID_MENU_FILE_EXIT",""); CExtCmdItem * pCmdItem = g_CmdManager->CmdGetPtr( g_CmdManager->ProfileNameFromWnd(AfxGetMainWnd()->GetSafeHwnd(), ID_FILE_EXIT ); ASSERT (pCmdItem != NULL); pCmdItem->m_sMenuText = strName;
//repeat previous 4 lines for all commands }
CMainMenuBar::_UpdateMenuBar(BOOL bDoRecalcLayout) { BOOL bRet = CExtMenuControlBar::_UpdateMenuBar(bDoRecalcLayout);
//I’m guessing that m_fileOptionLanguage is of type CFile, if not, use the appropiate CFile m_fileOptionLanguage = reinterpret_cast<CMainFrame *>(AfxGetMainWnd())->GetIniFile();
//change File menu string UINT nCmdId = m_wndMenuBar.GetButton(0)->GetCmdID(); CExtCmdItem *pCmdItem = g_CmdManager->CmdGetPtr( g_CmdManager->ProfileNameFromWnd(AfxGetMainWnd()->GetSafeHwnd()), nCmdId ); ASSERT( pCmdItem != NULL ); pCmdItem->m_sToolbarText = m_fileOptionLanguage.IniFileReadStringEx("MENU", "ID_MENU_FILE","");
//repeat previous steps for all menus
if( bDoRecalcLayout ) { Invalidate(); _RecalcLayoutImpl(); UpdateWindow(); } return bRet; }
As you can see, you don’t have to use GetMenu() anywhere in the code.
Regards: Chris
|
|
Ferdinand Rios
|
Jul 23, 2006 - 9:36 PM
|
The integration wizard cannot build at all (no log files created) and attempting to build manually using the workspace causes many errors. C:\Program Files\FOSS Software Inc\Prof-UIS\ProfAuto\ExtAutoCategories.cpp(65) : error C2668: ’InlineIsEqualGUID’ : ambiguous call to overloaded function Since there are no dependencies set at the workspace it is hard to gauge what has to build before what.
Build 2.51 worked fine. Please advise. Can you update the Integration wizard?
|
|
Ferdinand Rios
|
Jul 23, 2006 - 10:08 PM
|
Thought I’ll add some lines from the build report:
/*******************************************************************/ REPORT FILE [7-23-2006, 20:57] /*******************************************************************/
Library build for Visual Studio 98 (Win32 platform) Build "ProfUIS254nd - ANSI/Debug (ProfUISDLL - Win32 ANSI Debug)" - failed Output file: "C:\Program Files\FOSS Software Inc\Prof-UIS\Bin_600\ProfUIS254nd.lib" 0 errors, 0 warnings Report file: "C:\Program Files\FOSS Software Inc\Prof-UIS\Bin_600\ANSIDebug\ProfUISDLL\buildlog.htm"
Library build for Visual Studio 98 (Win32 platform) Build "ProfUIS254n - ANSI/Release (ProfUISDLL - Win32 ANSI Release)" - failed Output file: "C:\Program Files\FOSS Software Inc\Prof-UIS\Bin_600\ProfUIS254n.lib" 0 errors, 0 warnings Report file: "C:\Program Files\FOSS Software Inc\Prof-UIS\Bin_600\ANSIRelease\ProfUISDLL\buildlog.htm"
The report files mentioned don’t actually exists.
|
|
Technical Support
|
Jul 24, 2006 - 4:08 AM
|
We guess you have some newer Platform SDK installed on your computer. This may cause problems like described in your message. Please invoke the Tools | Options menu in Visual C++ 6.0 and select the Directories tab. Check the Include files list for all the newer Platform SDKs that should be moved to the bottom of the list.
|
|
V M
|
Jul 23, 2006 - 3:04 AM
|
There are several questions and/or issues with the CExtTabPageContainerWnd (V2.54) which I will put under this one subject in hope that someone can confirm them and/or suggest a resolution:
1. How can a CExtResizableDialog "page" contained within the CExtTabPageContainerWnd have a thin border around it - e.g. similar to the style of visual studio 8 solution explorer window where the container does NOT have the border but the "property page" is bounded?
I have tried setting WS_EX_STATICEDGE on the child (page) dialog itself, but this appears to be automatically reset (the border disappears) as soon as the container tab is clicked.
My motivation for this is to have the theme appearance for a child property sheet within a dialog form with multiple property pages since CExtResizablePropertySheet does not support themes other than Office2000 in this configuration (as documented).
2. CExtTabPageContainerWnd does not appear to support keyboard control switching between different tab pages, and also does not allow TAB to escape the page?
Setting WS_TABSTOP window style on the container DOES enable TAB key to work WITHIN the page dialog (i.e. tab between child controls on the contained "page"), and TAB focus change TO one of the child controls FROM a control on the main dialog will work, however once the focus is INSIDE the contained page, there is no way to TAB out of it, nor can the tab-control itself gain focus so that cursor keys can be used to switch between different pages.
Vojin
|
|
V M
|
Jul 23, 2006 - 7:06 PM
|
Thank you very much for answering my questions, and very promptly indeed! Both solutions work terrific! Thanks again.
(PS: do you know if different themes will be supported by CExtResizablePropertySheet in tabbed (child window) configuration in a future release of Prof-UIs or are there any technical reasons - "the windows factor" that may prevent that?)
Cheers!
|
|
Technical Support
|
Jul 24, 2006 - 5:09 AM
|
We believe the CExtTabPageContainerWnd window is a good replacement for the CPropertySheet window in the tabbed mode. The CExtResizablePropertySheet window is present in Prof-UIS mostly as a skinned wizard control. The CExtTabWnd window used in CExtTabPageContainerWnd is not based on the CTabCtrl window, which is used in CPropertySheet. This is the single incompatibility.
|
|
Technical Support
|
Jul 23, 2006 - 12:21 PM
|
The thin border can be applied using the CExtWRB template class (WRB stands for Window in Resizable Bar) which is designed for adding a border around any window (as you can see in controls inside dockable panes in Visual Studio). You can use this template class in the declaration of your dialog class: class CYourDialog : public CExtWRB < CExtResizableDialog > Or you can simply use it directly in the declaration of your dialog variable: CExtWRB < CYourDialog > m_wndYourDialog; The tab page container uses a Visual Studio-like flat tab window which does not support keyboard operations. But the tab page container supports Ctrl+PageUp and Ctrl+PageDown for switching between pages. The same key combinations are supported in the tabbed group of control bars.
|
|
YS Jang
|
Jul 22, 2006 - 12:23 AM
|
Hi,
Recently, I have changed Prof-uis 2.54 instead of 2.50
But, The error occurs on the InstallPaintManager()
=============
CMainFrame::CMainFrame() { g_PaintManager.InstallPaintManager(new CExtPaintManagerOffice2007_R2_LunaBlue); .... }
CExtPaintManagerOffice2007_R2_LunaBlue::CExtPaintManagerOffice2007_R2_LunaBlue() { .... VERIFY(m_bmpDCA.LoadBMP_Resource(MAKEINTRESOURCE(IDB_EXT_2007_DCA_LUNA_BLUE); .... }
CExtBitmap::LoadBMP_Resource(...) { ... if (hInst == NULL) { hInst = g_ResourceManager.FindResourceHandle(...);
//the error occurs //hInst is NULL if (hInst == NULL) { ... return false; //Exit Program } } } g_PaintManager.InstallPaintManager(new CExtPaintManagerOffice2007_R2_LunaBlue); .... }
How can I resolve this? thanks..
|
|
Technical Support
|
Jul 23, 2006 - 12:29 PM
|
Please check the following: 1) Do not invoke the g_PaintManager.InstallPaintManager() code in the constructor of your CWinApp -derived class. You can use the InitInstance() method of this class or any method (including a constructor) of the class which implements the main window. 2) If you link you app with Prof-UIS statically, please add the following lines to the .rc2 file of your project: #if ( !(defined _AFXDLL && !defined __STATPROFUIS_WITH_DLLMFC__) )
#include <Resources/Resource.rc>
#endif You can see these lines in all the .rc2 files in our samples. This allows Prof-UIS resources to be embedded into your compiled EXE (or DLL). As a result, the static Prof-UIS has the same feature set as the Prof-UIS DLL.
|
|
delu qiu
|
Jul 21, 2006 - 10:33 AM
|
Hi,
How to remove minimize and maximize button on CMDIFrameWnd? the frame window minimized when click maximize button.
|
|
Technical Support
|
Jul 23, 2006 - 12:23 PM
|
You can remove the WS_MINIMIZE and WS_MAXIMIZE styles from your frame window. This can be done in the PreCreateWindow() virtual method which should call the parent class method first and then invoke the cs.style &= ~(WS_MINIMIZE|WS_MAXIMIZE) code. Another solution is to modify the system menu of the main frame window in the OnCreate() method. You should invoke the GetSystemMenu(FALSE) code to get a CMenu pointer that represents the system menu of your main frame window. Just disable the SC_MAXIMIZE and SC_MINIMIZE commands in this menu using the CMenu::EnableMenuItem() method.
|
|
delu qiu
|
Jul 26, 2006 - 9:36 AM
|
I tried both way, neither of them works.
this is my code: class CMainFrame : public CExtNCW < CMDIFrameWnd > { .... }
class CMainView :public CExtWA < CExtWS < CExtAFV < CFormView > > > { ..... }
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { bClosed=FALSE; CRect cRect; cRect.right = GetSystemMetrics (SM_CXSCREEN); cRect.top = GetSystemMetrics (SM_CYSCREEN) - GetSystemMetrics(SM_CYSCREEN) * 2;
cRect.left = cRect.right - 150; cRect.bottom = cRect.top + GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYSCREEN) * 2;
if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; // TODO: Add your specialized creation code here 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 ) ); g_CmdManager->UpdateFromToolBar( pApp->m_pszProfileName, IDR_MAINFRAME8 ); g_CmdManager->UpdateFromToolBar( pApp->m_pszProfileName, IDR_MAINFRAME9 );
UINT arrCommandIDs[] = { ID_APP_EXIT, ID_APP_BACK, ID_APP_HELP, ID_MSG_DOWNLOAD, ID_MSG_PRINT, ID_APP_ABOUT}; if( !m_wndToolBar.Create(_T( "iflash Toolbar" ), this, AFX_IDW_TOOLBAR ) ) { TRACE0( "Failed to create toolbar" ); return -1; } m_wndToolBar.SetButtons( arrCommandIDs, sizeof(arrCommandIDs)/sizeof(arrCommandIDs[0]) ); m_wndToolBar.InitContentExpandButton();
bBigBar=TRUE;
if (!m_wndSplitter.CreateStatic(this, 1, 2, WS_CHILD | WS_VISIBLE, AFX_IDW_PANE_FIRST )) return FALSE;
// First, build the view context structure CCreateContext ccx; CCreateContext ccx1;
// Designate the class from which to build the view ccx.m_pNewViewClass = RUNTIME_CLASS(CMainView); ccx1.m_pNewViewClass = RUNTIME_CLASS(CMessageView);
if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CMainView), CSize(GetSystemMetrics (SM_CXSCREEN)-DEF_SPLITPOS, 100), &ccx) || !m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CMessageView), CSize(DEF_SPLITPOS, 100), &ccx)) { m_wndSplitter.DestroyWindow(); return FALSE; }
// Using the structure, create a view m_pMainView = DYNAMIC_DOWNCAST( CMainView, m_wndSplitter.GetPane (0,0));
// Did we succeed ? if ( !m_pMainView ) { TRACE0("Creation of view failed"); } // Do layout recalc m_wndSplitter.SetColumnInfo(0,GetSystemMetrics (SM_CXSCREEN),300); m_wndSplitter.SetColumnInfo(1,20,20); m_pMainView->SetScaleToFitSize(CSize(800,500));
// Order it to resize the parent window to fit m_pMainView->ResizeParentToFit(FALSE);
m_pRightView = DYNAMIC_DOWNCAST( CMessageView, m_wndSplitter.GetPane (0,1));
if ( !m_pRightView) { TRACE0("Creation of view failed"); return 0; }
CMenu * menu=GetSystemMenu(FALSE); menu->EnableMenuItem (SC_MINIMIZE,MF_DISABLED);
return 0; }
|
|
Technical Support
|
Jul 26, 2006 - 12:17 PM
|
We are sorry. Please use the following line in the PreCreateWindow() virtual method: cs.style &= ~(WS_MINIMIZEBOX|WS_MAXIMIZEBOX);
|
|
Franklyn Suliveres
|
Jul 21, 2006 - 6:16 AM
|
After encountering the problem the first time, I reinstalled form scratch VS2005 and Prof-UIS.
Interestingly enough, the 64bit builds were successful (although I dont need them).
The Prof-UIS Paths, to environment variables for win32 and the Application Wizard oprations were successful.
All of the Lib builds for VS 2005 for the Win32 platform failed.
I cannot determine why the Integration Wizard fails in builiding these libraries. The error msg states that while compiling stdafx.cpp, the afxwin.h file is missing producing an error. Below is a Build log for one of the libraries. All have the same error.
Thank you, Franklyn Suliveres
========================================================================= Build Log Rebuild started: Project: ProfUISDLL, Configuration: ANSI Debug|Win32 Command Lines Creating temporary file "c:\Program Files\FOSS Software Inc\Prof-UIS\Bin_800\AnsiDebug\ProfUISDLL\RSP00000131522424.rsp" with contents [ /Od /I "..\Include" /D "_DEBUG" /D "_AFXEXT" /D "__PROF_UIS_IMPL__" /D "_WIN32_WINNT=0x0400" /D "_WIN32_IE=0x0400" /D "WIN32" /D "_WINDOWS" /D "_VC80_UPGRADE=0x0600" /D "_WINDLL" /D "_AFXDLL" /Gm /EHsc /RTC1 /MDd /Yc"stdafx.h" /Fp".\..\Bin_800\AnsiDebug\ProfUISDLL/ProfUISDLL_800.pch" /Fo".\..\Bin_800\AnsiDebug\ProfUISDLL/" /Fd".\..\Bin_800\AnsiDebug\ProfUISDLL/" /W4 /c /Zi /TP ".\StdAfx.cpp" ] Creating command line "cl.exe @"c:\Program Files\FOSS Software Inc\Prof-UIS\Bin_800\AnsiDebug\ProfUISDLL\RSP00000131522424.rsp" /nologo /errorReport:prompt" Creating temporary file "c:\Program Files\FOSS Software Inc\Prof-UIS\Bin_800\AnsiDebug\ProfUISDLL\RSP00000231522424.rsp" with contents [ /Od /I "..\Include" /D "_DEBUG" /D "_AFXEXT" /D "__PROF_UIS_IMPL__" /D "_WIN32_WINNT=0x0400" /D "_WIN32_IE=0x0400" /D "WIN32" /D "_WINDOWS" /D "_VC80_UPGRADE=0x0600" /D "_WINDLL" /D "_AFXDLL" /Gm /EHsc /RTC1 /MDd /Yu"stdafx.h" /Fp".\..\Bin_800\AnsiDebug\ProfUISDLL/ProfUISDLL_800.pch" /Fo".\..\Bin_800\AnsiDebug\ProfUISDLL/" /Fd".\..\Bin_800\AnsiDebug\ProfUISDLL/" /W4 /c /Zi /TP ".\ProfUISDLL.cpp"
"..\Src\ExtTreeWnd.cpp"
"..\Src\ExtTreeGridWnd.cpp"
"..\Src\ExtToolControlBar.cpp"
"..\Src\ExtToolBoxWnd.cpp"
"..\Src\ExtTaskPaneWnd.cpp"
"..\Src\ExtTabWnd.cpp"
"..\Src\ExtTabPageContainerWnd.cpp"
"..\Src\ExtTabFlatWnd.cpp"
"..\Src\ExtTabbedToolControlBar.cpp"
"..\Src\ExtSplitterWnd.cpp"
"..\Src\ExtSpinWnd.cpp"
"..\Src\ExtSliderWnd.cpp"
"..\Src\ExtShortcutListWnd.cpp"
"..\Src\ExtScrollWnd.cpp"
"..\Src\ExtRibbonBar.cpp"
"..\Src\ExtResizableDialog.cpp"
"..\Src\ExtReportGridWnd.cpp"
"..\Src\ExtPropertyGridWnd.cpp"
"..\Src\ExtProgressWnd.cpp"
"..\Src\ExtProfUISAboutDialog.cpp"
"..\Src\ExtPopupMenuWnd.cpp"
"..\Src\ExtPopupCtrlMenu.cpp"
"..\Src\ExtPaintManager.cpp"
"..\Src\ExtPageNavigatorWnd.cpp"
"..\Src\ExtPageContainerWnd.cpp"
"..\Src\ExtNcFrame.cpp"
"..\Src\ExtMouseCaptureSink.cpp"
"..\Src\ExtMiniDockFrameWnd.cpp"
"..\Src\ExtMenuControlBar.cpp"
"..\Src\ExtMdiWindowsListDlg.cpp"
"..\Src\ExtLabel.cpp"
"..\Src\ExtImageEditWnd.cpp"
"..\Src\ExtIconEditDlg.cpp"
"..\Src\ExtHook.cpp"
"..\Src\ExtGroupBox.cpp"
"..\Src\ExtGridWnd.cpp"
"..\Src\ExtEdit.cpp"
"..\Src\ExtDurationWnd.cpp"
"..\Src\ExtDockBar.cpp"
"..\Src\ExtDatePicker.cpp"
"..\Src\ExtControls.cpp"
"..\Src\ExtControlBarTabbedFeatures.cpp"
"..\Src\ExtControlBar.cpp"
"..\Src\ExtContentExpandWnd.cpp"
"..\Src\ExtComboBox.cpp"
"..\Src\ExtColorPaletteWnd.cpp"
"..\Src\ExtColorDlg.cpp"
"..\Src\ExtColorCtrl.cpp"
"..\Src\ExtCmdManager.cpp"
"..\Src\ExtCmdIcon.cpp"
"..\Src\ExtCheckListWnd.cpp"
"..\Src\ExtButton.cpp"
"..\Src\ExtBtnOnFlat.cpp" ] Creating command line "cl.exe @"c:\Program Files\FOSS Software Inc\Prof-UIS\Bin_800\AnsiDebug\ProfUISDLL\RSP00000231522424.rsp" /nologo /errorReport:prompt" Creating temporary file "c:\Program Files\FOSS Software Inc\Prof-UIS\Bin_800\AnsiDebug\ProfUISDLL\RSP00000331522424.rsp" with contents [ /Od /I "..\ProfUISDLL" /I "..\Include" /D "_DEBUG" /D "_AFXEXT" /D "__PROF_UIS_IMPL__" /D "_WIN32_WINNT=0x0400" /D "_WIN32_IE=0x0400" /D "WIN32" /D "_WINDOWS" /D "_VC80_UPGRADE=0x0600" /D "_WINDLL" /D "_AFXDLL" /Gm /EHsc /RTC1 /MDd /Yu"stdafx.h" /Fp".\..\Bin_800\AnsiDebug\ProfUISDLL/ProfUISDLL_800.pch" /Fo".\..\Bin_800\AnsiDebug\ProfUISDLL/" /Fd".\..\Bin_800\AnsiDebug\ProfUISDLL/" /W4 /c /Zi /TP "..\Src\ExtStatusControlBar.cpp"
"..\Src\ExtCustomize.cpp" ] Creating command line "cl.exe @"c:\Program Files\FOSS Software Inc\Prof-UIS\Bin_800\AnsiDebug\ProfUISDLL\RSP00000331522424.rsp" /nologo /errorReport:prompt" Output Window Compiling... StdAfx.cpp c:\program files\foss software inc\prof-uis\profuisdll\stdafx.h(33) : fatal error C1083: Cannot open include file: ’afxwin.h’: No such file or directory Results Build log was saved at "file://c:\Program Files\FOSS Software Inc\Prof-UIS\Bin_800\AnsiDebug\ProfUISDLL\BuildLog.htm" ProfUISDLL - 1 error(s), 0 warning(s)
|
|
V M
|
Jul 23, 2006 - 2:06 AM
|
Hi Franklyn,
If you navigate to C:\Documents and Settings\<your user name>\Local Settings\Application Data\Microsoft\VisualStudio\8.0 directory and rename the VCComponents.dat file to another filename, you should find that it fixes the issue.
In addition, you will also need to manually add Prof-UIs directories in your visual studio by opening Tools->Options->Projects and Solutions->VC++ Directories and add: C:\Program Files\FOSS Software Inc\Prof-UIS\Include C:\Program Files\FOSS Software Inc\Prof-UIS\Bin_800 C:\Program Files\FOSS Software Inc\Prof-UIS\Src
directories in Include files, Library files and Source files respectively. (If you’ve added any custom directory paths previously, you will need to examine your old VCComponents.dat file to find out which ones need to be added in addition).
This problem appears to be a bug with the Prof-UIs installation process which makes assumption on the user configuration file’s presence and content.
Regards, Vojin
|
|
Technical Support
|
Jul 23, 2006 - 12:15 PM
|
We would only like to add the following. The Integration Wizard saves a copy of the VCComponents.Dat file before modifying it. The <Program Files>\Foss Software Inc\Prof-UIS\Support\BACKUP folder keeps all the original versions of VCComponents.Dat and instructions on how to restore Visual Studio 2005 settings. We are sorry for this inconvenience and will try to fix this problem in the next version by recoding this feature from scratch to avoid this problem in the future.
|
|
delu qiu
|
Jul 20, 2006 - 12:43 PM
|
Hi,
I want to slove my Frame and Dialog window flash problem, these windows applied Prof-UIS skin. It take about half second to completely display the dialog, and the dialog controls flash during the half second. And Frame window flash even longer.
I use xml skin so that I can use my own skin picture file. Does binary skin perform better?
Is there any skin solution to prevent the flash?
Thanks
======================================================== Frame Window ======================================================== class CMainFrame : public CExtNCW < CMDIFrameWnd > { ...
}
CMainFrame::CMainFrame() { CExtPaintManagerSkin * pPM = new CExtPaintManagerSkin; if( ! pPM->m_Skin.Load( LPCTSTR(strPath) ) ) { ::AfxMessageBox( _T("Failed to load initial skin.") ); delete pPM; } else g_PaintManager.InstallPaintManager( pPM );
}
=========================================== Dialog Window =========================================== class CDlgChrysler:public CExtNCW < CExtResizableDialog> { ... }
int CDlgChrysler::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CDialog::OnCreate(lpCreateStruct) == -1) return -1; ....
CExtPaintManagerSkin * pPM = new CExtPaintManagerSkin; if( ! pPM->m_Skin.Load( LPCTSTR(strPath) ) ) { ::AfxMessageBox( _T("Failed to load initial skin.") ); delete pPM; } else g_PaintManager.InstallPaintManager( pPM ); return 0; }
|
|
Technical Support
|
Jul 21, 2006 - 4:38 AM
|
First of all, there is no reason to install the paint manager twice. That is why you have a delay before the dialog appears on the screen. If you do not know what should appear on the screen first, the dialog or frame window, you should put the code which initializes the paint manager into the InitInstance() virtual method of the CWinApp -derived class. We may also guess you have this flickering because you forgot to specify the WS_CLIPCHILDREN window style in the properties of the dialog template resource.
|
|
delu qiu
|
Jul 21, 2006 - 7:58 AM
|
First, the dialog window and the frame window are seperate project. For the dialog window, I followed the sample code to load the skin in OnCreate() function. I specify the WS_CLIPCHILDREN window style to dialog, the window is still flickering but it was light improved. the window are runtime responsive when the skin was disabled.
when the window flickering, I can see the buttons be paint at its design-time postion first, and then move to its runtime postion.
I should mention I have used photoshop to change several image file in skin folder: Aqua\Button\ControlPushButton\Hover.png Aqua\Button\FrameNcButton\Active\.... Aqua\WindowNcArea\FrameActive.png Aqua\WindowNcArea\FrameInActive.png
I only change image color. and it flickering same way when I use original skin file.
|
|
Technical Support
|
Jul 23, 2006 - 12:30 PM
|
These details about your project are important but we still have no enough information to provide you with a solution. Would you send us a test project?
|
|
Massimo Germi
|
Jul 20, 2006 - 10:34 AM
|
Hi, there is a method to hide a column in a CExtGridWnd derived Class? I need to have a reference to a row and a record in a table af a DB. The method I would like to implement is to have a column in witch I insert record ID of a record and then hide it. When I need to update one record I have its reference in a hided column.
Tx very much
|
|
Technical Support
|
Jul 21, 2006 - 4:30 AM
|
The truly hidden columns are supported only in the CExtReportGridWnd class. But you don’t need to save some row specific data in any hidden column. This data can be saved in a header column that have a zero width. This is similar to a hidden column and does not affect selection/focus of inner data cells
|
|
Massimo Germi
|
Jul 21, 2006 - 6:56 AM
|
TX, good idea. But if a user try to resize a column near it? Is there a possibility that expands yhe column with 0 width?
tx again
|
|
Technical Support
|
Jul 23, 2006 - 12:35 PM
|
The header columns are similar to header rows. The user can change the column width by clicking between header cells at the top or at the bottom. The user can also change the row height by clicking between header cells on the left or on the right. But it is not possible to change the header row height at the top/bottom or the header column width on the left/right. So, the header column with a zero width will always be invisible regardless of any user actions.
|
|
Massimo Germi
|
Jul 24, 2006 - 4:06 AM
|
|
|
Andrew Cochran
|
Jul 20, 2006 - 5:46 AM
|
>:) I’m in trouble again!
I’ve notice one more problem in my MDI application. When mouse is moving throw it’s window (any place) my CPU is loaded on 100%. I’ve already read topics about Idle in this forum, but none was helpfull. As I have undestood, I have do insert the following lines into OnCreate function body of CMainFrame class ????
CExtControlBar::g_bEnableOnIdleCalls = true; CExtGridWnd::g_bEnableOnIdleCalls = true; CExtPopupBaseWnd::g_bEnableOnIdleCalls = true; CExtTabWnd::g_bEnableOnIdleCalls = true; .... But nothing changes :(
Please help! How can I resolve this?
|
|
Technical Support
|
Jul 21, 2006 - 4:26 AM
|
This also depends on how heavy your command updating methods are. Please do the following test: comment out some message map entries for particular command updating method and run your application. This will help you find the bottlenecks. For instance, the CCmdUI::Enable() and CCmdUI::Set() check methods should depend on some flags which are known persistently. You should not perform any heavy actions like database access to enable/disable any command or set its checked state.
|
|
Andrew Cochran
|
Jul 21, 2006 - 5:34 AM
|
I see, but sure that it’s not the reason. The problem is even if you create an empty MDI project using prof-uis application wizard. I’ve done the test you sugested - nothing changed. I’ve done another one, created empty MDI application by wizard - the result is the same.
I’ve noticed once more. If I override the OnIdle method and always return true in it, CPU capacity comes down to about 30%. But problems with MDITabs appear and I know that it’s not solution.
Need help!
|
|
Technical Support
|
Jul 24, 2006 - 8:46 AM
|
We are sorry for the delay with this reply. We spent some time on testing the DRAWCLI sample. This sample is available in MFC and it also comes with Prof-UIS. The plain MFC version uses standard toolbars and built-in menu line in the window non-client area. Of course, it is an MDI project. Actually we do not see any performance differences in both cases. The CPU usage is caused by MFC’s command updating mechanism and does not bring any problems. We had the 100% usage only on old computers with CPU frequency less than 1 GHz.
|
|
Andrew Cochran
|
Jul 19, 2006 - 3:12 AM
|
When I use CExtGridCellFile to give users an ability for enter path to file, dialog doesn’t appear when my program is launched under Windows 98. But in WinXP everything is OK!
Please suggest how can I give my program the ability to show file dialog in Win98, when user is clicking the button on CExtGridCellFile.
Thanks.
|
|
Technical Support
|
Jul 19, 2006 - 9:05 AM
|
We tested CExtGridCellFile on Windows 98 and found no problems. The file open dialog always appears. This is implemented in the CExtGridCellFile::OnButtonPressed() virtual method. Of course, you can override this method in your class and implement any custom behavior.
|
|
Andrew Cochran
|
Jul 20, 2006 - 1:59 AM
|
Thnks. But I still have the problem when using CExtGridCellFile only. I’ve created a CExtGridCellFile derived class and call my FileDialog class in OnButtonPressed method. Now it works.
May be it depends on MY version of Windows 98.
Best regards!
|
|
Technical Support
|
Jul 20, 2006 - 6:33 AM
|
We tested CExtGridCellFile on Windows 98 SE. Please let us see your variant of the OnButtonPressed() method.
|
|
Andrew Cochran
|
Jul 24, 2006 - 1:38 AM
|
Here it is
virtual void OnButtonPressed( CExtGridWnd & wndGrid, INT /*nButtonType*/, const RECT & /*rcCellExtra*/, const RECT & /*rcCell*/, LONG /*nVisibleColNo*/, LONG /*nVisibleRowNo*/, LONG nColNo, LONG nRowNo, INT nColType, INT nRowType ) { Dialogs::FileDialog dlg(true, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT , L"Bitmap files (*.bmp)|*.bmp|GIF Files (*.gif)|*.gif|JPEG Files (*.jpg; *.jpeg)|*.jpg;*.jpeg|PNG Files (*.png)|*.png|TIFF Files (*.tif)|*.tif|All files (*.*)|*.*||"); if (dlg.DoModal() == IDOK) { TextSet(dlg.GetPathName()); wndGrid.OnGridCellInputComplete(*this, nColNo, nRowNo, nColType , nRowType); } }
|
|
Technical Support
|
Jul 24, 2006 - 8:47 AM
|
Our file dialog window has the OFN_EXPLORER style, which may be the cause of the problem.
|
|
Andrew Cochran
|
Jul 19, 2006 - 3:00 AM
|
Hi, again!
My select listbox in CExtPropertyGridComboBoxBar does not have vertical scroll bar. How can I turn it on and set autoscroll property to it?
I need it, because I have a lot of elements which properties need to be displayed!
Thanks.
|
|
Technical Support
|
Jul 19, 2006 - 9:49 AM
|
Thank you for reporting the problem. Please update the following method: bool CExtPropertyGridComboBoxBar::Create(
CWnd * pWndParent,
bool bVisible // = true
)
{
ASSERT_VALID( this );
ASSERT( GetSafeHwnd() == NULL );
ASSERT_VALID( pWndParent );
ASSERT( pWndParent->GetSafeHwnd() != NULL );
CRect rc( 0, 0, 0, 400 );
if( ! CExtComboBox::Create(
WS_CHILD
| ( bVisible ? WS_VISIBLE : 0 )
|WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_VSCROLL
|CBS_DROPDOWNLIST|CBS_HASSTRINGS,
rc,
pWndParent,
__EXT_MFC_ID_PROPERTY_GRID_COMBO_BOX
)
)
{
ASSERT( FALSE );
return false;
}
SetFont(
CFont::FromHandle(
(HFONT)::GetStockObject(DEFAULT_GUI_FONT)
)
);
return true;
} We just added the WS_VSCROLL style to the combo box.
|
|
Andrew Cochran
|
Jul 20, 2006 - 2:03 AM
|
Thanks for this too! :) Now it looks and works good!
Best regards!
|
|
Daljit Singh
|
Jul 18, 2006 - 2:07 AM
|
|
|
Technical Support
|
Jul 18, 2006 - 9:09 AM
|
Did you try the ShowSizeGrip() method? ShowSizeGrip( FALSE );
|
|
Daljit Singh
|
Jul 18, 2006 - 11:29 AM
|
I have tried ShowSizeGrip( FALSE ), ShowSizeGrip( NULL); With this property page doesn’t show the grip but you can stil resize the page.
|
|
Daljit Singh
|
Jul 18, 2006 - 6:24 PM
|
Hi have tried
1. ShowSizeGrip( FALSE ), ShowSizeGrip( NULL); 2. Overriding WindowProc()
LRESULT CMyWizard::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { if( message == WM_SIZE ) CPropertySheet::WindowProc( message, wParam, lParam ); else return CExtResizablePropertySheet::WindowProc(message, wParam, lParam); }
LRESULT CMyWizardPage::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { if( message == WM_SIZE ) CPropertyPage::WindowProc( message, wParam, lParam ); else return CExtResizablePropertyPage::WindowProc(message, wParam, lParam); }
I even tried overiding OnSize() but still couldn’t stop the wizard sized to resize. Is theren any other way to stop changing the size of wizard pages.
Thanks
Daljit Singh
|
|
Technical Support
|
Jul 19, 2006 - 9:02 AM
|
The ShowSizeGrip() method is used to hide/show the resizing gripper. It does not modify the WS_THICKFRAME window style, which indicates whether the window is resizable. For dialogs, you need to set the Border property in the dialog editor to Dialog Frame. For CExtResizablePropertySheet , the WS_THICKFRAME window style is turned on by default. To disable resizing, simply remove this style: ModifyStyle( WS_THICKFRAME, 0 );
ShowSizeGrip( FALSE );
|
|
Eddie Judson
|
Jul 17, 2006 - 11:38 PM
|
Hi, I have a grid in a dialog that I would like to disable and have it look grey lilke the rest of the disabled controls, is there an easy way of doing this? Regards, Eddie
|
|
Technical Support
|
Jul 18, 2006 - 9:41 AM
|
Unfortunately at the moment the grid does not check if it is disabled and does not pant the background grayed. But there is a workaround. You can override the CExtGridWnd::OnSiwPaintBackground() method in this way: void CDemoGrid::OnSiwPaintBackground(
CDC & dc,
bool bFocusedControl
) const
{
ASSERT_VALID( this );
CExtGridWnd::OnSiwPaintBackground( dc, bFocusedControl );
CRect rcGridInner = OnSwGetClientRect();
if( (! dc.RectVisible( &rcGridInner ))
|| IsWindowEnabled()
)
return;
COLORREF clrFill =
OnSiwGetSysColor( COLOR_3DFACE );
dc.FillSolidRect( &rcGridInner, clrFill );
}
|