Subject |
Author |
Date |
|
Dominik Braendlin
|
Oct 3, 2007 - 4:05 AM
|
Dear Tech Support Our MDI application consists of a main frame e.g. CMainFrame and several child frames e.g. CMDIChildWnd. I would like to save the main window position plus the last position of the child frames. Saving the main window position is not a problem. Saving the window position of the child windows seams not to work. I am using the following code snippet. CWinApp * pApp = ::AfxGetApp(); ASSERT( pApp != NULL ); ASSERT( pApp->m_pszRegistryKey != NULL ); ASSERT( pApp->m_pszRegistryKey[0] != _T(’\0’) );
GetWindowPlacement(&m_dataFrameWP);
VERIFY(CExtControlBar::ProfileBarStateSave( this, pApp->m_pszRegistryKey, pApp->m_pszProfileName, m_sProfileName, &m_dataFrameWP)); I found out that the m_dataFrameWP changes once the ProfileBarStateSave has been executed. It seems to me as if the m_dataFrameWP contains the window pos of the main window. What am I doing wrong? Does my need for saving all the window positions go along with the philosophy of the ProfUIs framework or does it only allow me to save the main windows position but not the child windows position? Is there an example on using the bEnableThrowExceptions if it is true? Try catch blocks.
|
|
Technical Support
|
Oct 3, 2007 - 7:30 AM
|
The CExtControlBar::ProfileBarStateSave() method allows you to load the window position of the main frame window. This position is used in the ActivateFrame() virtual method of the main frame class. This mechanism is not supported for MDI child frame windows because Prof-UIS does not know how many documents/views/MDI child frames are implemented in your project and how to identify each particular MDI child frame when loading/saving its window position. If you need MDI child frames to be persistent, this feature should be implemented in scope of your project as it is described in the following article:
Persistent Frames by Stefan Chekanov
|
|
tera t
|
Oct 3, 2007 - 2:37 AM
|
|
|
Technical Support
|
Oct 3, 2007 - 11:33 AM
|
|
|
tera t
|
Oct 3, 2007 - 8:50 PM
|
Hello.
I revised the following source. __EXT_MFC_INT_PTR CExtBarContentExpandButton:: OnToolHitTest
A tool tip was not displayed. Thank you.
|
|
Thomas Maurer
|
Oct 2, 2007 - 11:56 PM
|
Hello
IMPORTANT: I am still using V2.54 because of "never change a winning horse" philosophy. If upgrading might solve my problem I will gladly upgrade but I am afraid upgrading will not do.
I have an application using Prof-UIS heavily. This application should now be made an Internet Explorer plugin, kind of in the same way Acrobat Reader is a stand-alone software as well as a plugin in IE.
So I have made my application an OLE server. Porting went fine so far until I came across the following problem: In my non-OLE scenario I create my own instance of a class derived from CExtDynTabControlBar by using the message CExtControlBar::g_nMsgCreateTabbedBar.
In my OLE scenario this does not work because the frame window is created by the MFC framework and so I can not receive above message. I do get my hands on the class when the following virtual method is called for my in-place frame:
CFrameInPlace::OnCreateControlBars(CFrameWnd* pWndFrame, CFrameWnd* pWndDoc)
It is this method where I create and dock the toolbars as childs of pWndFrame. I tried subclassing pWndFrame but this is not allowed because pWndFrame is a window of the IE process.
So I think receiving CExtControlBar::g_nMsgCreateTabbedBar is out of the question here.
What alternatives do I have? Do I have to create my own frame window somehow within the IE frame window so that I have more control about the frame containing the bars?
Thank you in advance
Thomas
|
|
Thomas Maurer
|
Oct 11, 2007 - 9:31 AM
|
Thanks for your reply. I now have introduced a CFrameWnd just for the purpose of being a host of toolbars in "my" process vs. Internet Explorer process. And it works.
|
|
Technical Support
|
Oct 3, 2007 - 12:59 PM
|
To create your own frame window would be the best solution in this case. The frame class could be a popup frame window when running as a standalone application. It would be a child of OLE in-place frame when embedded into IE. The CFrameWnd windows can be both popup and child.
|
|
Suhai Gyorgy
|
Oct 2, 2007 - 9:43 AM
|
Dear Support,
In one of our toolbars we need to display 2 comboboxes right next to each other. This works fine but I can’t figure out how to leave some gap between the 2 comboboxes. Adding a separator doesn’t look good.
I’ve read something about CToolBar::SetButtonInfo, that it can set the width of a button which has a TBBS_SEPARATOR style, but CExtToolControlBar::SetButtonInfo is missing one parameter compared to CToolBar::SetButtonInfo, so I can’t use that here.
Could you please advise? Thank you!
|
|
Technical Support
|
Oct 2, 2007 - 12:37 PM
|
There are two ways. First, you can code your own CExtBarButton -derived class that implements the CExtBarButton::CalculateLayout() and CExtBarButton::_UpdateCtrl() methods. In the CExtBarButton::CalculateLayout() , you should invoke the parent class’s method and return a wider CSize object in order to reserve the needed space on the right side of the attached combo box. Leave CExtBarButton::_UpdateCtrl() similar to the original one, but reposition the attached combo box window to the location which is less wide than the button’s width. The first combo box button should use such a toolbar button class.
The second way is a bit simpler. Just use a disabled command button between the combo box buttons. This button should also be based on your own CExtBarButton -derived class that implements the CExtBarButton::CalculateLayout() method. This method should simply return CSize(3,1) with 3 being the number of pixels between combo boxes. Finally use CExtToolControlBar::InsertSpecButton() to use your custom button class for a particular toolbar button.
If you encounter any difficulties, please do not hesitate to contact us.
|
|
Suhai Gyorgy
|
Oct 3, 2007 - 2:36 AM
|
I’ve implemented the second solution, it works great, thank you!
|
|
Henry Tso
|
Oct 2, 2007 - 9:34 AM
|
Dear Sir,
I want to initial the position of the control bar when it floating at the first time after program installed. Can I do that?
Best Regards,
|
|
Technical Support
|
Oct 2, 2007 - 12:26 PM
|
There are two methods, CExtControlBar::SetInitDesiredPosFloating() and CExtControlBar::SetInitDesiredSizeFloating() , that allow you to specify the initial location and size of a floating control bar.
|
|
Chris Anderson
|
Oct 1, 2007 - 4:33 PM
|
hi there,
I ran into a ribbon bar prolem related to shortcut key : ribbon bar is not able to capture shortcut key when co-existing with a menu bar.
Our app creates a main frame window, which in turn creates both a menu bar and a ribbon bar. Based on the configuration, it shows either only the menu bar or only the ribbon bar.
The ribbon bar is created in this way, for a menu ( like &Page ), a ribbon tab is created :
CExtRibbonNodeTabPage *pRibbonTabPage = new CExtRibbonNodeTabPage( ...); ... pRibbonTabPage->CmdKeyTipSet( new CExtCustomizeCmdKeyTip( ’P’), false );
Once the ribbon bar is created, the menu bar will be hidden.
When the app is running, pressing ALT + P is not able to switch to the Page tab, instead, the menu bar will pop up, which doesn’t look good, is there any way to make sure it’s the ribbon bar, not the menu bar, capture the shortcut key ?
|
|
Suhai Gyorgy
|
Oct 2, 2007 - 1:50 AM
|
Just a guess. I’d try to override PreTranslateMessage in MainFrame like this: BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
if( "menubar is visible" && m_wndMenuBar.TranslateMainFrameMessage( pMsg ) )
return TRUE;
if( "ribbonbar is visible" && m_wndRibbonBar.TranslateMainFrameMessage( pMsg ) )
return TRUE;
return CExtNCW < CFrameWnd > :: PreTranslateMessage(pMsg);
}
|
|
Chris Anderson
|
Oct 2, 2007 - 12:06 PM
|
Actually this is what I did. I found out that WM_SYSKEYUP is filtered out in our app, so I make sure this msg and WM_SYSKEYDOWN, WM_SYSCHAR and WM_KEYDOWN msg are not filtered out.
I’m still having problem, but I would like to make sure all the msg used by prof-uis are not filtered out. Could you confirm ?
Thanks
|
|
Chris Anderson
|
Oct 2, 2007 - 12:19 PM
|
I just fixed an error in the msg filtering, so it’s working now.
Thanks
|
|
tera t
|
Sep 28, 2007 - 1:05 AM
|
Hello.
I do not understand how to use __EGBS_AUTO_FOCUS_BOTTOM_RIGHT well. When can it utilize?
|
|
Technical Support
|
Sep 28, 2007 - 9:15 AM
|
This style should be used in a CExtGridWnd grid control with an Excel-like selection model, i.e. when some abstract ranges of cells can be selected rather than only a single cell, a single row or a single column. If this style is set on and you select a cell range from cell (3,4) to cell (8,7) , then the bottom/right cell in this range with coordinates (8,7) will be both selected and focused. If this style is turned off, the top/left cell with coordinates (3,4) will be focused instead.
|
|
tera t
|
Sep 28, 2007 - 10:35 PM
|
Hello.
At last I was able to understand.
|
|
Martin Chapman
|
Sep 27, 2007 - 12:11 PM
|
I installed my licensed copy of Prof-UIS and let it build the libraries and integrate with Visual Studio. However, I got several build errors when attempting to link:
Library build for Visual Studio 2005 (Win32 platform) Build "ProfSkin280nd - ANSI/Debug (ProfSkinDLL - Win32 ANSI Debug)" - failed Output file: "C:\Program Files\FOSS Software Inc\Prof-UIS\Bin_800\ProfSkin280nd.lib" 2 errors, 15 warnings Report file: "C:\Program Files\FOSS Software Inc\Prof-UIS\Bin_800\ANSIDebug\ProfSkinDLL\buildlog.htm"
Library build for Visual Studio 2005 (Win32 platform) Build "ProfSkin280n - ANSI/Release (ProfSkinDLL - Win32 ANSI Release)" - failed Output file: "C:\Program Files\FOSS Software Inc\Prof-UIS\Bin_800\ProfSkin280n.lib" 2 errors, 15 warnings Report file: "C:\Program Files\FOSS Software Inc\Prof-UIS\Bin_800\ANSIRelease\ProfSkinDLL\buildlog.htm"
Library build for Visual Studio 2005 (Win32 platform) Build "ProfSkin280md - MBCS/Debug (ProfSkinDLL - Win32 MBCS Debug)" - failed Output file: "C:\Program Files\FOSS Software Inc\Prof-UIS\Bin_800\ProfSkin280md.lib" 2 errors, 15 warnings Report file: "C:\Program Files\FOSS Software Inc\Prof-UIS\Bin_800\MBCSDebug\ProfSkinDLL\buildlog.htm"
Library build for Visual Studio 2005 (Win32 platform) Build "ProfSkin280m - MBCS/Release (ProfSkinDLL - Win32 MBCS Release)" - failed Output file: "C:\Program Files\FOSS Software Inc\Prof-UIS\Bin_800\ProfSkin280m.lib" 2 errors, 15 warnings Report file: "C:\Program Files\FOSS Software Inc\Prof-UIS\Bin_800\MBCSRelease\ProfSkinDLL\buildlog.htm"
How can I re-run the setup wizard to rebuild these?
|
|
Technical Support
|
Sep 27, 2007 - 2:28 PM
|
There are two libraries that should be compiled first, before compiling the ProfSkin library: ZLib and LibPNG.
|
|
Suhai Gyorgy
|
Sep 27, 2007 - 12:56 PM
|
In C:\Program Files\FOSS Software Inc\Prof-UIS\ProfUISLib folder you can find many solution files. You will need ProfUISLIB_800.sln . Open it with VS and choose the build configurations which failed during integration. Then you can rebuild them and check the errors listed.
|
|
Pierre MEDART
|
Sep 27, 2007 - 9:39 AM
|
In our legacy application, we are using an CTreeControl.
The tooltips, that we display is this tree, are old fashioned (yellow). How can we get the new tooltip look (Office2007) ?
We’d also like to use these tooltip on a grid (not a prof-ui one).
We use a paint manager that is based on the CExtPaintManagerOffice2007_Blue or CExtPaintManagerOffice2007_Blak
|
|
Technical Support
|
Sep 27, 2007 - 2:24 PM
|
You could use a CExtTreeGridWnd control with a single column proportionally resized to the entire client area’s width (the __EGBS_BSE_EX_PROPORTIONAL_COLUMN_WIDTHS style should be applied) instead of the tree view common control. This grid control should have one header row at top. If you don’t need the header row, you can set its height to zero (using the OuterRowHeightSet() method).
|
|
Pierre MEDART
|
Sep 27, 2007 - 4:30 AM
|
In our application, users can run scripts on various object.
The scripts are triggered by a contextual menu that is associated with a range of command ids.
We build a CMenu and use it to create the CExtPopUpMenu.
Our issue is that if we have two type of object, A and B, having different script defined on themselves AScript1, AScript2, BScript1, but we use the same ID1 for AScript1 and BScript1.
When we rightclick for the first time on a B object, the contextual menu is correctly displayed but if we call it on a A object than the contextual menu will be BScritp1 and AScript2
I guess it is because the command manager links the ID1 with BScript1. Is there a way to tell the CommandManager that the displayed text must be updated ?
|
|
Pierre MEDART
|
Sep 27, 2007 - 7:25 AM
|
Thanks, with a few changes we could make it.
|
|
Suhai Gyorgy
|
Sep 27, 2007 - 6:21 AM
|
g_CmdManager->UpdateFromMenu(AfxGetApp()->m_pszProfileName, IDR_YOUR_MENU, true); should do the trick.
|
|
Suhai Gyorgy
|
Sep 26, 2007 - 6:59 AM
|
Dear Support,
In our application we need to implement drag-n-drop of some user-defined data. This happens on a dialog on which there is a tabpagecontainer. The user needs to be able to change the tab during dnd. This works great, we used an approach very-very similar to the one you have in your FormEditor sample, in class CFormEditorMdiTabWnd (OnDragOver changes selection, if needed).
Our problem is that we use CExtTabPageContainerOneNoteWnd-derived class. This class draws the tabs different while hovering over them. I’d like to draw the hovering state even during drag-n-drop. CExtTabWnd::OnTabWndMouseTrackingHoverStart seems to be useful, but first: it is a protected method, second: I’m not sure when to call it and its pair, CExtTabWnd::OnTabWndMouseTrackingHoverStop.
Could you please help me implement this feature? Thank you! Chris
|
|
Technical Support
|
Sep 27, 2007 - 1:25 PM
|
Please download an updated version of the FormEditor sample with the tab items that become hovered when a toolbox item is being drag-and-dropped over them.
|
|
Suhai Gyorgy
|
Sep 28, 2007 - 4:22 AM
|
It works great, thank you!
|
|
Technical Support
|
Sep 26, 2007 - 9:07 AM
|
If you open several documents in the FormEditor sample and start dragging a tool over MDI tab items, you will notice that a tab becomes selected, when it is covered with the mouse pointer during this operation. This allow you to select any form document when you are dragging a toolbox item. So, here is tab selection that is important while the hover effect is not important at all. Please let us know more details about the tab control behavior inside one note tab page container, you are looking for. Of course it’s possible to repaint tab items so that they correspond to normal or hovered states during drag-n-drop but we need to know what exactly you need? If you want to highlight drop target tab items only, you could code a own tab page container like as follows: class CYourOneNoteTabControl : public CExtTWPC < CExtTabOneNoteWnd >
{
. . .
};
class CYourPageContainerWnd : public CExtTabPageContainerOneNoteWnd
{
public:
virtual CExtTabWnd* OnTabWndGetTabImpl()
{
return new CYourOneNoteTabControl;
}
}; The CYourOneNoteTabControl control should implement the OLE drop target functionality and you can use the CFormEditorMdiTabWnd class from the FormEditor sample as an example. Additionally, the CYourOneNoteTabControl class should implement the CExtTabOneNoteWnd::OnTabWndDrawItem() virtual method so it invokes the parent class method and mark the drop target item as hovered. To mark a tab item as hovered, you should set the CExtTabWnd::m_nHoverTrackingHitTest value equal to the nItemIndex parameter of the OnTabWndDrawItem() virtual method. If you don’t need the standard hovered look of the tab item, you should paint it manually.
|
|
Suhai Gyorgy
|
Sep 26, 2007 - 1:13 PM
|
"So, here is tab selection that is important while the hover effect is not important at all." Yes, I realize that hover effect is not essential in this case, I’d still like to implement it. "Of course it’s possible to repaint tab items so that they correspond to normal or hovered states during drag-n-drop" This is exactly what I need!
If you could guide me through how to implement this in FormEditor sample, that would be enough for me to do it in my own application. As the first step, I changed every instance of CExtTabMdiWhidbeyWnd to CExtTabMdiOneNoteWnd in the sample. Now, if I run the sample, I see the hover effect when I’m not doing drag-n-drop, but the hover effect is missing during drag-n-drop.
As the next step, I try to follow your instructions: implement OnTabWndDrawItem virtual method and invoke the parent class method in it. But what did you mean by "mark drop target item as hovered"? How do I know in my OnTabWndDrawItem which tab item my drop target is?
I was thinking I should add some code to OnDragOver but I’m not sure what. I can’t change CExtTabWnd::m_nHoverTrackingHitTest value in CMdiTabOleDropTarget::OnDragOver, because it is a protected variable.
Could you please be a little more specific? Thank you!
|
|
Roongrit Charoensupkul
|
Sep 26, 2007 - 12:33 AM
|
I test using CExtGridCellScientific in ProfUIs controls sample application. When I enter the value 1e-14 to the cell with scientific cell type for the first time, the text is shown 1.00e-14 as I expected. But if I tried to edit the cell with the value 1.00e-14 in it, when the control in the cell change to edit box, the value is set to zero. I don’t want the value to be changed. What should I do?
|
|
Technical Support
|
Sep 27, 2007 - 5:55 AM
|
We improved the CExtGridCellScientific cell so now the inplace editor is initialized with a value in an exponential form.
Please add the following changes to Prof-UIS. Add the following method declaration to the header of CExtGridCellScientific virtual void OnQueryTextForInplaceControl(
CExtSafeString & strCopy
) const; Then add its implementation void CExtGridCellScientific::OnQueryTextForInplaceControl(
CExtSafeString & strCopy
) const
{
ASSERT_VALID( this );
if( (GetStyleEx()&__EGCS_EX_UNDEFINED_ROLE) != 0
|| IsEmpty()
)
{
strCopy = _T("");
return;
}
TextGet( strCopy );
}
|
|
David Skok
|
Sep 21, 2007 - 7:50 AM
|
I would like to request the member CExtTreeGridWnd::ItemSetCell that would work similar to CExtGridWnd::GridCellSet but taking an HTREEITEM to identify the row.
Thanks, Dave
|
|
Technical Support
|
Sep 21, 2007 - 2:15 PM
|
|
|
Suhai Gyorgy
|
Sep 21, 2007 - 6:55 AM
|
Dear Support,
Your Help file says that CExtGridBaseWnd::EditCell method "activates the in-place editor control for a specified cell and returns...". But used this method returns only after the user finished editing in the cell. And even though Help file states that bContinueMsgLoop parameter is used for different purposes, I tried setting it to false but that didn’t change this behaviour either. I would like to I can hack it by sending WM_LBUTTONDOWN message to the grid, but I really don’t like this solution ( maybe its matching WM_LBUTTONUP should be sent as well ).
Is there any other solution for this? Actually I need it for the following situation:
In OnGbwFocusChanging I check if the user is trying to leave the selected (focused) line (fullrow selection is set). Then I check if the "key" cell of the line is filled, otherwise I warn the user and force the key cell to get into edit mode. If I use EditCell here and the user tries to change the selection by clicking on another line (thus trying to change the focus as well), the key cell gets into edit mode and after completing the edit, the selection goes onto the line clicked earlier (focus stays on the line we just edited). If I could somehow refuse changing the selection in OnGbwFocusChanging, the problem could be solved without the use of PostMessage.
Thank you!
|
|
Technical Support
|
Sep 27, 2007 - 2:13 PM
|
We received your e-mail and replied yesterday.
|
|
Suhai Gyorgy
|
Sep 28, 2007 - 2:46 AM
|
The solution is working great. Thank you very much for the help!
|
|
Technical Support
|
Sep 24, 2007 - 12:40 PM
|
We have just created the simplest possible application which should meet your requirements. Everything is implemented in the CMyGridWnd class except for test data initialization. Please let us know if it is what you are looking for?
|
|
Suhai Gyorgy
|
Sep 26, 2007 - 6:44 AM
|
I’ve replied by e-mail, along with the modified project.
|
|
Technical Support
|
Sep 23, 2007 - 2:02 PM
|
We need to discuss some more details. When the user is typing something in a cell and wants to finish editing, the user can do this in several ways. When the user presses Enter or Tab, VK_RETURN or VK_TAB can be handled to check the input. But what about when the user clicks or double clicks any cell in the same row? Should we treat this as the user finishes editing and some handler is needed to verify the input?
Besides what should we do if other application or popup window is activated? Should we remove the edited row at all in this case?
We think in any case all grid cells in the grid should be marked as read-only and only one row should be editable until you add it to the database. This makes the entire task simpler because you will be unable to start editing other rows. But it is still not clear when the grid control will know that the data input is complete in all the cells in the editable row and data base writing should be performed.
It is also possible to simplify your task. We can enable any input in any cell inside the edited row. You will be able to activate the editor for any cell and use any keys except for VK_RETURN . The VK_RETURN key will be used for final data verification in all the cells and further writing to database or starting the editor in the first found column with incorrect data.
|
|
Suhai Gyorgy
|
Sep 24, 2007 - 2:11 AM
|
Here are the answers to your questions one by one:
> We need to discuss some more details. When the user is typing something in a cell and wants to finish editing, the user can do this in several > ways. When the user presses Enter or Tab, VK_RETURN or VK_TAB can be handled to check the input. But what about when the user clicks > or double clicks any cell in the same row? Should we treat this as the user finishes editing and some handler is needed to verify the input? No, verifying is not needed in this case.
> Besides what should we do if other application or popup window is activated? Should we remove the edited row at all in this case? No, verifying and removing the editing row is not needed in this case either.
> We think in any case all grid cells in the grid should be marked as read-only and only one row should be editable until you add it to the database. This is already implemented in our application. > This makes the entire task simpler because you will be unable to start editing other rows. But it is still not clear when the grid control will know > that the data input is complete in all the cells in the editable row and data base writing should be performed.
I couldn’t provide the exact code earlier, but here is the condition inside my OnGbwFocusChanging to tell me when to do verification (and if verification is passed, I do database writing: if ( ptOldFocus.y >= 0 && ptOldFocus.y != ptNewFocus.y && row with index ptOldFocus.y is editable) . Inside this if I do the verification and return false; if it fails and write to database (and change cells to read-only) otherwise. All I need is to be able to reset selection changing along with focus changing when I need to return false . Please, reread all the posts of this thread to check the solution I already have with PostMessage. I’m just looking for a function which would force editing mode and returns right away.
> It is also possible to simplify your task. We can enable any input in any cell inside the edited row. You will be able to activate the editor for any > cell and use any keys except for VK_RETURN. The VK_RETURN key will be used for final data verification in all the cells and further writing to > database or starting the editor in the first found column with incorrect data. No, this special use of the VK_RETURN would make the grid and this feature very user-unfriendly, because it is not what the user expects from a grid.
|
|
Technical Support
|
Sep 22, 2007 - 12:50 PM
|
It seems you should use a different approach for controlling user input and preventing input of incorrect data. You can override the CExtGridWnd::OnGridCellInplaceControlTextInputComplete() virtual method which is invoked after inplace editor is destroyed. This method allows you to apply or cancel the editing result. You can start the editor again if the result is invalid. You can override the CExtGridWnd::OnGridCellInplaceControlTextInputVerify() virtual method for implementing on-the-fly verification during text typing. You can override the CExtGridWnd::OnGridCellInplaceControlPreTranslateMessage() virtual method and implement message pre-translation for the inplace active editor window. You can override the CExtGridWnd::OnGridCellInplaceControlWindowProc() virtual method and hook the window procedure of the inplace active cell editor for handling mouse and keyboard events like you need. You can let us know what exactly you are going to edit and how exactly it can be verified so we can code a small grid with complete prevention of incorrect input.
|
|
Suhai Gyorgy
|
Sep 22, 2007 - 3:05 PM
|
We need to verify input when user tries to leave the selected row. The grid in question is really a read-only grid, but when user presses a button on the dialog, a new line is added to the grid, which stays editable only while the user stays on the row. The item represented by the row should be inserted to the database after all needed fields are filled and the user leaves the row. But the solutions you suggested are all for verifying input during or instantly after editing one single cell.
|
|
Technical Support
|
Sep 21, 2007 - 11:07 AM
|
The local message loop is tracked until cell editing is complete. But the grid supports a feature which allows you to edit the next/previous grid cell when the user presses the right/left arrow keys in the end/beginning of the active cell editor window. That is why we implemented a re-usable message loop. The user can potentially walk through one million of cells and grid should not invoke the cell editing message loop for each cell again because the stack size is not unlimited. You should not expect any results from the EditCell() API. It can wait for the message loop and end of editing in certain case and do not wait in other cases. We believe we have implemented all the possible virtual methods for controlling start/end/validation and on-the-fly validation events in the in-place activated cell editor controls. Please let us know more details about your task so we can help you. Especially which events you need to catch?
|
|
Suhai Gyorgy
|
Sep 21, 2007 - 3:01 PM
|
I want to validate one cell of a line when the user leaves the line (selects another line, either with up/down arrow or by clicking on another line). If validation fails, I want to warn the user with a messagebox and force the inproper cell into edit mode.
Unfortunately my code is not in front of me right now, but here is a simplified version of it. virtual bool OnGbwFocusChanging(
const POINT & ptOldFocus,
const POINT & ptNewFocus,
bool & bEnsureVisibleColumn,
bool & bEnsureVisibleRow,
bool & bResetSelectionToFocus,
bool & bRedraw
)
{
if ( !CExtGridWnd::OnGbwFocusChanging(
ptOldFocus,
ptNewFocus,
bEnsureVisibleColumn,
bEnsureVisibleRow,
bResetSelectionToFocus,
bRedraw) )
return false;
if ( ptOldFocus.y >= 0 && ptOldFocus.y != ptNewFocus.y ) { // focus is changing from a valid line to another one
if ( key cell of ptOldFocus.y line is invalid ) {
AfxMessageBox(_T("You made a mistake"));
EditCell(key column index, ptOldFocus.y);
return false;
}
}
return true;
}
Using this code, when the user makes a mistake in the key cell and then clicks another line, the message box pops up, then the key cell gets into edit mode and when the user finishes editing, the previously clicked line gets the selected state but the focus stays on the line we just edited. I want the selection state to stay on the edited line as well. I hope it’s clear.
|
|
tera t
|
Sep 21, 2007 - 3:42 AM
|
Hello.
Unless I incorporate "Windows XP Visual Style" .... Will not some functions of Prof-UIS be usable?
In addition, I do not understand embodiment of "Windows XP Visual Style" well.
|
|
Technical Support
|
Sep 21, 2007 - 2:14 PM
|
We are ready to improve Prof-UIS APIs for you. But we implement the custom window non-client area only in Office 2007 and ProfSkin paint managers. This is only one case you need to code your custom caption button support. The Windows 2000 and Windows XP non client areas look differently and they should be assumed as other two cases. The window non-client area Windows Vista is provided by DWM subsystem (desktop window manager) and minimize/maximize/close buttons are organized into one group there. We are not sure if embedding additional buttons on Windows Vista is a good idea. If you are using custom caption buttons only in one application only, then it’s much easier to code it in one case: the skinned Office 2007 captions only and show these captions on all Windows OS versions.
|
|
Krustys Donuts
|
Sep 20, 2007 - 4:14 PM
|
We load the application UI state (toolbar positions) with this code:
WINDOWPLACEMENT dataFrameWP; CWinApp *app = AfxGetApp(); CExtControlBar::ProfileBarStateLoad( this, app->m_pszRegistryKey, app->m_pszProfileName, app->m_pszProfileName, &m_dataFrameWP);
This fatally crashes if there has been a change to the application which has added or removed toolbars or windows. Deleteing the registry keys fixes the crash. There does not appear to be a way to validate state before loading which might prevent this crash.
How do we validate state so that we can skip the load if it would otherwise cause a crash? A try / catch block around the ProfileBarStateLoad call does not prevent a crash.
Thanks in advance!
|
|
Suhai Gyorgy
|
Sep 21, 2007 - 1:24 AM
|
From around version 2.51, there has been a new parameter added to ProfileBarStateLoad, called bEnableThrowExceptions. By default, this is false, but if you call ProfileBarStateLoad with bEnableThrowExceptions set to true, a try/catch block will prevent the crash. Same goes for CExtCmdManager::SerializeState.
|
|
Paul Cowan
|
Sep 20, 2007 - 12:27 PM
|
After double clicking on a column header to auto resize the column width, the column is resized correctly, but all the other columns to the right are resizeed very small. It appears the grid is resizing the columns so all the columns will fit on the screen. How do I stop the grid from resizing the other columns?
|
|
Paul Cowan
|
Sep 20, 2007 - 1:43 PM
|
So how do I turn off auto resizing for the columns?
|
|
Suhai Gyorgy
|
Sep 21, 2007 - 1:27 AM
|
If I understood the problem right, you should remove__EGBS_BSE_EX_PROPORTIONAL_COLUMN_WIDTHS style with the use of CExtGridWnd::BseModifyStyleEx method.
|
|
Technical Support
|
Sep 20, 2007 - 1:00 PM
|
We guess you are using the auto resizing feature for columns in your grid control. That means when you best fit some column, then all the other columns on the right should be resized because in the auto sizing mode the summary width of all the columns should be the same as the width of grid’s client area.
|
|
Suhai Gyorgy
|
Sep 20, 2007 - 6:30 AM
|
Dear Support,
In August there was a thread Walking data in the CExtReportGridWnd control. In it a kind of bug was described concerning CExtTreeGridWnd::ItemGetNext method. As the poster described, with a little more coding it is possible to solve the problem, but I’d need proper functioning of ItemGetPrev now.
I need to implement Search function in our ReportGrid so I need to be able to step up/down one item in the grid, and if a match is found, I need to make the item visible (expanded) if it wasn’t so before. Have you fixed ItemGetNext/ItemGetPrev to be able to step through all items (visible or not, expanded or not, first/last child of an inner item or not)?
Thank you very much!
|
|
Technical Support
|
Sep 23, 2007 - 1:27 PM
|
We did some refactoring with regard to the ItemGetNext() and ItemGetPrev() methods (they were initially designed for internal use): virtual HTREEITEM ItemGetNext(
HTREEITEM hTreeItem,
bool bSiblingOnly,
bool bExpandedWalk,
bool bIncludeHidden
) const;
virtual HTREEITEM ItemGetPrev(
HTREEITEM hTreeItem,
bool bSiblingOnly,
bool bExpandedWalk,
bool bIncludeHidden
) const; The bIncludeHidden parameter allows you to skip hidden tree items. Hidden columns, rows and tree items have been implemented recently (after 2.80). The bSiblingOnly parameter allows you to enumerate only sibling items if it set to true ( bExpandedWalk is ignored in this case). The bExpandedWalk parameter allows you to skip tree items that have collapsed parent items if it set to true . The updated methods are tested and demonstrated in a new version of the TestTreeItemWalk test project. Please also download the updated source code of Prof-UIS from our ftp server.
|
|
Suhai Gyorgy
|
Sep 24, 2007 - 4:19 AM
|
Works as needed now, thank you very much!
|
|
Technical Support
|
Sep 21, 2007 - 11:00 AM
|
We created a test application to check the execution of the CExtTreeGridWnd::ItemGetNext() and CExtTreeGridWnd::ItemGetPrev() methods with all the possible combinations of their parameters. It allows to walk through tree items forward and backward starting from the focused item. Could you tell us what should be improved exactly using this application as a starting point?
|
|
Suhai Gyorgy
|
Sep 21, 2007 - 1:18 PM
|
What I’d like to achieve is to get the numbers 0, 1, 2, 3, ..., 20, all in an increasing order in the list on the right. But this should happen in any state of the grid ( even if all items are closed and only 0, 7 and 14 can be seen ). No matter what flags I try to set in ItemGetNext, I can’t get this. And of course ItemGetPrev should result in 20, 19, 18, ..., 0.
|
|
Massimo Germi
|
Sep 20, 2007 - 4:33 AM
|
Hi to all support staff, do you have any some news about printing support in CExtTreeGridWnd?
Tx a lot
|
|
Technical Support
|
Sep 20, 2007 - 8:54 AM
|
We have added some new features with regard to printing and print preview. Now it is possible to hide selectively columns and rows in the generated printing/preview output. This is supported for outer header columns and rows and for inner data columns and rows including the tree rows of report grid and tree grid. Here the details of implementation:
- Added the __EGCS_EX_PPVW_HIDDEN extended style that can be used with CExtGridCell*** classes. This style, when applied to header cells, allows you to hide columns and rows in the print/preview output. The following new handy methods in the CExtGridCell class gets/sets this style flag: virtual bool HiddenInPrintPreviewGet() const;
virtual void HiddenInPrintPreviewSet( bool bHiddenInPrintPreview ); - Added the following virtual methods to the CExtGridWnd class: virtual bool OnGridQueryPpvwVisibilityForColumn(
LONG nColNo,
INT nColType
) const;
virtual bool OnGridQueryPpvwVisibilityForRow(
LONG nRowNo,
INT nRowType
) const; - Added the following new virtual method to the CExtTreeGridWnd class (so, it can also be used in CExtReportGridWnd ) because the OnGridQueryPpvwVisibilityForRow() virtual method is not used in the tree grid and report grid: virtual bool OnTreeGridQueryPpvwVisibilityForItem(
const CExtTreeGridCellNode * pNode
) const; To hide a tree row in the print/preview output, you should invoke the following code: HTREEITEM hti = . . .
CExtGridCell * pTreeNodeCell = (CExtGridCell*)hti;
pTreeNodeCell->HiddenInPrintPreviewSet( true ); To hide a tree row of the report grid in the print/preview output you should invoke the following code: CExtReportGridItem * pRGI = . . .
pRGI->HiddenInPrintPreviewSet( true ); To hide any data column/row you should get its header cell at the top/on the left and use: pHeaderCell->HiddenInPrintPreviewSet( true ); To hide an outer header column/row in the print/preview output in any of our grids, you should override the OnGridQueryPpvwVisibilityForColumn() and/or OnGridQueryPpvwVisibilityForRow() virtual methods and return false for appropriate columns/rows which you would like to make hidden. We have several other requests for improvement of this subsystem but they are not implemented yet. You can download the updated code via ftp. If you do not know the password, please request it at support@prof-uis.com.
|
|
Adam Keadey
|
Sep 19, 2007 - 3:10 PM
|
I decided to post this issue alone
I want to detect the user click on a docking window. I have no problem doing this by using WM_LBUTTONDOWN in my CExtControlBar derived class.
When the window is floating the notifications do not get send through CExtCotnrolbar, but are sent through CExtMiniDockWnd. I’m attempting to derive a class from from CExtMiniDockWnd, but when the application starts it always creates a CExtMinDockWnd, not my derived class.
Within the static function FrameEnableDocking the m_pFloatingFrameClass is set to CExtMiniDockFrame. I don’t see anything that I can simply override to set the runtime class to my derived class.
Maybe There is altogether a simpler way to get a mouse click on the title bar whether floating or docked.
|
|
Suhai Gyorgy
|
Sep 20, 2007 - 1:46 AM
|
Short answer: There’s an overridable method CExtControlBar::OnCreateFloatingFrame, check out default implementation and override it to create your own CExtMiniDockFrameWnd.
But what would you like to achieve with handling WM_LBUTTONDOWN message? Maybe there is an easier way to achieve it, which would be the same for both control bar states.
|
|
Adam Keadey
|
Sep 20, 2007 - 8:41 AM
|
CExtControlBar::OnCreateFloatingFrame will handle when the control bar is undocked to become floating, but it does not handle a control bar that is floating on startup. Prof-uis sets the m_pFloatingFrameClass to CExtMiniDockFrame which is the class that will be used to create the floating control bar.
I’m going to have my control flash when there is something that I need the user to acknolledge on that control bar. When the user clicks on the title bar the flashing will stop.
I was attempting to use the WM_LBUTTONDOWN message to stop the flashing.
|