Subject |
Author |
Date |
|
Rado Manzela
|
Aug 6, 2009 - 1:20 PM
|
I need to iterate over visible items in the tree grid. This is start of my loop: for (item=ItemGetNext(ItemGetRoot(),false,false,false);item;)
Since ItemGetFirstChild() does not have parameter selecting visible items only, I’ve used ItemGetNext, but it returns hidden item, even when no item is visible. Can you check it please? Thank you.
|
|
Technical Support
|
Aug 10, 2009 - 6:18 AM
|
The following methods of the CExtTreeGridWnd class were designed for enumerating all tree items at any level without checking their visibility:
virtual LONG ItemGetChildCount( HTREEITEM hTreeItem ) const;
virtual HTREEITEM ItemGetChildAt( HTREEITEM hTreeItem, LONG nPos ) const;
virtual HTREEITEM ItemGetFirstSibling( HTREEITEM hTreeItem ) const;
virtual HTREEITEM ItemGetLastSibling( HTREEITEM hTreeItem ) const;
virtual HTREEITEM ItemGetFirstChild( HTREEITEM hTreeItem ) const;
virtual HTREEITEM ItemGetLastChild( HTREEITEM hTreeItem ) const;
You can use these methods and invoke the CExtTreeGridWnd::ItemIsHidden() method for skipping hidden tree items. Please provide us with more details about how we should test the CExtTreeGridWnd::ItemGetNext() method. How many items should be inserted into the tree grid? Which items should we hide? Which should be used as the enumeration start point?
|
|
Rado Manzela
|
Aug 10, 2009 - 11:42 AM
|
I’ve tried it with 2 items, each has 1 child.
Then this code shows 1st item although all items are hidden: HTREEITEM iit = ItemGetFirstChild(ItemGetRoot());
for (; iit != NULL; iit = ItemGetNext(iit,true,false,true))
{
ItemHide(iit,true,true);
// ItemHide(iit,false,true);
}
iit=ItemGetNext(ItemGetRoot(),false,false,false);
if (iit)
{
CExtGridCell *c = ItemGetCell(iit,0);
CString tmp;
c->TextGet(tmp);
AfxMessageBox(tmp);
}
|
|
Technical Support
|
Aug 11, 2009 - 12:27 PM
|
Thank you for reporting this issue. To fix it, please update the source code for the following method:
CExtTreeGridCellNode * CExtTreeGridCellNode::TreeNodeGetNext(
bool bSiblingOnly,
bool bExpandedWalk,
bool bIncludeHidden
)
{
ASSERT_VALID( this );
if( bSiblingOnly )
{
if( m_pNodeNext == NULL )
return NULL;
ASSERT_VALID( m_pNodeNext );
if( bIncludeHidden )
return m_pNodeNext;
CExtTreeGridCellNode * pNode = m_pNodeNext;
for( ; pNode != NULL; pNode = pNode->m_pNodeNext )
{
ASSERT_VALID( pNode );
if( ! pNode->TreeNodeHiddenGet() )
return pNode;
}
return NULL;
} // if( bSiblingOnly )
if( TreeNodeGetChildCount() > 0
&& ( ( ! bExpandedWalk )
|| TreeNodeIsExpanded()
)
)
{
CExtTreeGridCellNode * pNode = TreeNodeGetChildAt( 0 );
if( bIncludeHidden )
return pNode;
for( ; pNode != NULL; pNode = pNode->m_pNodeNext )
{
ASSERT_VALID( pNode );
if( ! pNode->TreeNodeHiddenGet() )
return pNode;
}
return NULL;
}
CExtTreeGridCellNode * pNode = TreeNodeGetNext( true, false, bIncludeHidden );
if( pNode != NULL )
{
ASSERT_VALID( pNode );
return pNode;
}
pNode = this;
CExtTreeGridCellNode * pNodeParent = pNode->TreeNodeGetParent();
for( ; pNodeParent != NULL; )
{
ULONG nSiblingIndex = pNode->TreeNodeGetSiblingIndex();
ULONG nSiblingCount = pNodeParent->TreeNodeGetChildCount();
ASSERT( nSiblingIndex < nSiblingCount );
if( nSiblingIndex < (nSiblingCount-1) )
{
CExtTreeGridCellNode * pNodeTestNext = pNodeParent->TreeNodeGetChildAt( nSiblingIndex + 1 );
ASSERT_VALID( pNodeTestNext );
if( bIncludeHidden
|| ( ! pNodeTestNext->TreeNodeHiddenGet() )
)
{
if( ( ! bExpandedWalk )
|| pNodeParent->TreeNodeIsExpanded()
)
return pNodeTestNext;
}
return pNodeTestNext->TreeNodeGetNext( false, false, bIncludeHidden );
}
pNode = pNodeParent;
pNodeParent = pNodeParent->TreeNodeGetParent();
}
return NULL;
}
|
|
tera tera
|
Aug 5, 2009 - 1:30 AM
|
Hello. I want to change a position of the ControlBar as needed.
Is not there any good method?
|
|
Technical Support
|
Aug 10, 2009 - 7:43 AM
|
The CExtControlBar window supports 3 desired sizes. You can specify these sizes during your application initialization and before loading control bar states. This can be done with invocations of the CExtControlBar::SetInitDesiredSizeVertical() , CExtControlBar::SetInitDesiredSizeHorizontal() and CExtControlBar::SetInitDesiredSizeFloating:: methods and you can specify the equal desired sizes. But user resize bars at run-time and the desired sizes will become unequal. This is the feature of both Prof-UIS control bars and Visual Studio .NET / 2005 / 2008 dockable panes. The desired width are stored and loaded within the control bar states.
|
|
Technical Support
|
Aug 7, 2009 - 3:06 AM
|
Please take a look at the context menus displayed over the control bar caption in the ProfStudio sample application. These menus are completely re-built. The menu structure displays the real control bar window structure created by Prof-UIS inside the main frame window. The popup sub menus correspond to dynamic control bar containers at different level. The control bar layout is analyzed by the CMainFrame::OnConstructPopupMenuCB() method which builds custom context menus. As you can see, it’s possible to determine where each bar is really located. But entire control bar data structure is always quite complex .
|
|
Technical Support
|
Aug 5, 2009 - 10:35 AM
|
- You can use the CExtControlBar::DockControlBarInnerOuter() method for redocking the Class View bar into new inner position at any side.
- You can use the CExtControlBar::DockControlBarLTRB() method for redocking the Resource View bar into the same area with the Help Index control bar. You can also use this method for redocking the Class View bar into the same area with the Search Results bar.
There are only 5 types method for changing position of the CExtControlBar window:
1) The CExtControlBar::DockControlBarInnerOuter() method docks control bar into new inner or outer "circle" of bars inside the main frame window. The target and source bars can be in any state but auto hidden.
2) The CExtControlBar::DockControlBarLTRB() method docks control bar into the same area with other bar. The re-docked bar occupies part of other bar’s area at left/top/right/bottom. The target and source bars can be in any state but auto hidden.
3) The CExtControlBar::DockControlBarIntoTabbedContainer() method docks control bar into the same tabbed container with other. The target and source bars can be in any state but auto hidden.
4) The CExtControlBar::AutoHideModeSet() method auto-hides control bar or switches it back into simple docked state inside the main frame window.
5) The CExtControlBar::FloatControlBar() method switches control bar into the floating state. The bar can be in any state but auto hidden.
The CExtDynamicControlBar dynamic control bars also have the document mode and the CExtDynamicControlBar::BarStateSet() method should be used for changing states of dynamic control bar.
|
|
tera tera
|
Aug 5, 2009 - 7:02 PM
|
I want to investigate the position of the bar
|
|
tera tera
|
Aug 5, 2009 - 7:02 PM
|
At the size that appointed a bar, I want to let a bar dock.
|
|
tera tera
|
Aug 5, 2009 - 12:21 AM
|
Hello. Assert occurs when I operate a combo box in the following procedure. (1),You operate a combo box. (2),You push the cancel button. (3),Assert occurs.
|
|
tera tera
|
Aug 5, 2009 - 12:24 AM
|
|
|
Technical Support
|
Aug 5, 2009 - 10:35 AM
|
Thank you for reporting this issue. To fix it, please update the source code for the CExtComboBoxBase::~CExtComboBoxBase() method: CExtComboBoxBase::~CExtComboBoxBase()
{
CExtAnimationSite * pAcAS = AnimationClient_SiteGet();
if( pAcAS != NULL )
pAcAS->AnimationSite_ClientRemove( this );
LbItemRemoveAll();
if( m_pWndPopupListBox != NULL )
m_pWndPopupListBox->m_pCB = NULL;
if( m_pPopupListWnd != NULL )
{
delete m_pPopupListWnd;
m_pPopupListWnd = NULL;
}
}
|
|
Mantra
|
Aug 4, 2009 - 3:49 AM
|
I guess it’s a little bug in CExtTabPageContainerOneNoteWnd. I create several tabs (about 60) and hide them all. When I unhide item 1 (0) the drawing of the tab is ok. when I hide tab 1 (0) and unhide tab 2 (1) the left part of the tab is "cutted". Do you have any solution for this ? Thanks !!
|
|
Seiji Mukoyama
|
Aug 3, 2009 - 1:10 PM
|
Hi. I just purchased Prof-UIS v2.85. But I couldn’t build ProfUISDLL (MBCS Debug) with VS2008 SP1, Vista Ultimate and VS2008 crashed down!! How can I build dll??
|
|
Technical Support
|
Aug 4, 2009 - 1:54 AM
|
|
|
Seiji Mukoyama
|
Aug 4, 2009 - 5:31 AM
|
|
|
Daniel Verret
|
Aug 3, 2009 - 12:37 PM
|
I have a CExtTreeCtrl derived class which is created with the TVS_EDITLABELS style. I am unable to get the TVN_ENDLABELEDIT notification message when I stop editing the label. The following notification message handling works well with a CTreeCtrl but not with a CExtTreeCtrl: ON_NOTIFY_REFLECT(TVN_ENDLABELEDIT, OnTvnEndlabeledit) Any idea how to fix it? Thank you.
|
|
Daniel Verret
|
Jan 10, 2011 - 7:52 AM
|
When I paste text in a tree item label, the GetItemData crash. HTREEITEM seems valid: void CMyCode::OnInplaceControlComplete( __EXT_MFC_SAFE_LPCTSTR strEditedText, bool bEditingLabel )
{
if(bEditingLabel)
{
HTREEITEM hEditedItem = CExtTreeCtrl::GetInPlaceEditedItem();
DWORD_PTR = GetItemData(hEditedItem); Any Idea how to fix it?
|
|
Technical Support
|
Jan 11, 2011 - 7:49 AM
|
The CExtTreeCtrl::OnInplaceControlComplete() method sends a TVN_ENDLABELEDIT notification and invokes the GetInPlaceEditedItem() without any assertion failures. Could you provide the call stack listing?
|
|
Daniel Verret
|
Jan 11, 2011 - 1:50 PM
|
mfc80ud.dll!CTreeCtrl::GetItemData(_TREEITEM * hItem=0x01d1e820) Line 733 + 0x2f bytes C++
> CrowdWaysd.exe!CIdentitiesNavTree::OnInplaceControlComplete(const wchar_t * strEditedText=0x08e047f8, bool bEditingLabel=true) Line 1083 + 0xc bytes C++
ProfUIS289ud.dll!02d557a6()
[Frames below may be incorrect and/or missing, no symbols loaded for ProfUIS289ud.dll]
mfc80ud.dll!AfxCallWndProc(CWnd * pWnd=0x08e03440, HWND__ * hWnd=0x00761240, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 240 + 0x1c bytes C++
mfc80ud.dll!AfxWndProc(HWND__ * hWnd=0x00761240, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 389 C++
mfc80ud.dll!AfxWndProcBase(HWND__ * hWnd=0x00761240, unsigned int nMsg=31, unsigned int wParam=0, long lParam=0) Line 411 + 0x15 bytes C++
|
|
Technical Support
|
Jan 12, 2011 - 8:10 AM
|
The call stack listing is not detailed. We tried to reproduce the problem using the Tree View dialog page in the ProfUIS_Controls sample application. We modified the following method:
void CPageTreeCtrl::OnEndlabeleditTree1(NMHDR* pNMHDR, LRESULT* pResult)
{
HTREEITEM hEditedItem = m_wndTree.GetInPlaceEditedItem();
DWORD_PTR a_data = m_wndTree.GetItemData( hEditedItem );
a_data;
TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
pTVDispInfo;
*pResult = 1;
}
We cannot reproduce the problem. Of course, it’s not recommended to set a break point to the first line. It’s also not recommended to display modal dialogs and message boxes while processing tree item’s label editing result.
|
|
Technical Support
|
Aug 4, 2009 - 1:53 AM
|
The CExtTreeCtrl control does not use the built-in label editor of the Windows tree view common control. You should override the CExtTreeCtrl::OnInplaceControlComplete() virtual method. If the bEditingLabel parameter is true , then the label editing is finished and the CExtTreeCtrl::GetInPlaceEditedItem() method should be used for retrieving the HTREEITEM handle of edited item. Otherwise, the attached control is deactivated. The attached control is the extended feature of the CExtTreeCtrl class which allows you to show controls of several types after the label text. Please do not forget to invoke the parent class method finally.
|
|
Daniel Verret
|
Aug 4, 2009 - 7:20 AM
|
It works just fine now, thank you for your quick answer!
|
|
Robert Webb
|
Aug 2, 2009 - 11:34 PM
|
I may have missed something, but the sample code all seems to shows control bars with only a single control in them, such as a tree or list, which resizes with the control bar. I wish to have a tree control with some extra buttons at the bottom. But CExtControlBar is not derived from CExtResizableDialog, so I can’t use the auto-resizing commands. What’s the best way to do this with Prof-UIS? Thanks, Rob.
|
|
Technical Support
|
Aug 6, 2009 - 10:33 AM
|
You should override the OnCmdMsg() virtual method in the dialog C++ class which is used for creating a dialog window inside the control bar:
BOOL CYourDialog::OnCmdMsg(
UINT nID,
int nCode,
void * pExtra,
AFX_CMDHANDLERINFO * pHandlerInfo
)
{
ASSERT_VALID( this );
CFrameWnd * pFrameWnd = GetParentFrame();
ASSERT_VALID( pFrameWnd );
if( pFrameWnd->IsKindOf( RUNTIME_CLASS(CMiniFrameWnd) ) ) // bar is floating?
{
pFrameWnd = pFrameWnd->GetParentFrame();
ASSERT_VALID( pFrameWnd );
}
if( nID == ID_BUTTON_1 || nID == ID_BUTTON_2 || nID == ID_BUTTON_3 || . . . )
{
if( pFrameWnd->OnCmdMsg(
nID,
nCode,
pExtra,
pHandlerInfo
)
)
return TRUE;
}
return
CBaseOfYourDialog::OnCmdMsg(
nID,
nCode,
pExtra,
pHandlerInfo
);
} If you are using button common controls, then you should re-direct the OnCmdMsg() method invocations only for those dialog buttons which have the command handlers in the main frame window. The command updating invocations are not performed for button dialog controls. If you are using internal toolbar with buttons in your dialog, then both the command hander and updating hander invocations will be redirected to the mail frame window.
|
|
Robert Webb
|
Aug 6, 2009 - 9:21 PM
|
Thanks. That works as far as handling the messages from the buttons goes. However the buttons still don’t update correctly (they’re not pushed in or greyed out when they should be). It seems the dialog’s OnCmdMsg() is never called to update the buttons. What would be the best way to do this? The buttons are also missing their tooltips. Ideally it would be nice for updates and tips to be handled by the command manager just like the toolbar buttons. Thanks, Rob.
|
|
Technical Support
|
Aug 10, 2009 - 6:19 AM
|
The command updating queries are never sent by MFC for any HWND -based dialog controls. You should enable/disable dialog controls by invoking the CWnd::EnableWindow() API. You should check/uncheck button controls by invoking the CButton::SetCheck()() API.
|
|
Robert Webb
|
Aug 10, 2009 - 8:53 PM
|
I tried calling SetCheck() and EnableWindow() for the buttons during OnIdle() but for some reason these do not affect the buttons at all. I have no idea why. I also used SetTooltipText() but no tooltip appears. I looked at the ProfStudio example. The breakpoints control bar has buttons like I want, and for some reason the Update commands work for them, and they have tooltips. It creates an actual toolbar, whereas I am creating individual buttons. A toolbar is also HWND-based, although its buttons are not. Maybe that is the difference? I’ll try changing and see how it goes. Rob.
|
|
Robert Webb
|
Aug 10, 2009 - 9:56 PM
|
Hmm, another hurdle. Looks like a toolbar is the way to do what I want, and this toolbar will be part of the dialog and not dockable/movable. However looking at the ProfStudio sample, I can’t see how the toolbar is positioned. Seems it will always be placed at the top left, whereas I need my toolbar buttons elsewhere in the dialog. I tried calling SetWindowPos() for the toolbar in OnInitDialog(), but it changes nothing. I guess it’s docked. How can I choose where it goes on the dialog? Thanks, Rob.
|
|
Technical Support
|
Aug 11, 2009 - 12:30 PM
|
The toolbars are kind of MFC control bars and they are able to position themselves near tje borders of their parent windows automatically. Please take a look at the CProfStudioBreakpointsView class in the ProfStudio sample application. This class implements dialog window inside the Breakpoints resizable control bar. The Breakpoints window is the dialog window based on the IDD_DIALOG_BREAKPOINTS dialog template resource that contains one toolbar control (custom dialog control) and one list view control. The CProfStudioBreakpointsView class invokes the RepositionBars(0,0xFFFF,IDC_LIST_BREAKPOINTS); code at the end of the CProfStudioBreakpointsView::OnInitDialog() and CProfStudioBreakpointsView::OnSize() methods. The CWnd::RepositionBars() method places all the control bar windows with the dialog control identifiers in range 0...0xFFFF near the borders of the Breakpoints dialog and the window with the IDC_LIST_BREAKPOINTS dialog control identifier is repositioned to occupy the rest central free space of the Breakpoints dialog. The toolbar window is positioned at the top of the dialog because the IDC_BREAKPOINTS_TOOLBAR dialog control has the 0x50002034 style set which contains the CBRS_ALIGN_TOP (0x2000 ) control bar style.
|
|
Robert Webb
|
Aug 10, 2009 - 2:27 AM
|
Any answer to this? I tried using ON_UPDATE_COMMAND_UI in either the dialog or the control bar containing it, but the handlers never get called. I also overrode OnCmdMsg() in both and in the main frame, but again it is never called with the CN_UPDATE_COMMAND_UI code for buttons on my dialog. How do I get the buttons to update? And please don’t forget about tooltips too. Thanks, Rob.
|
|
Technical Support
|
Aug 11, 2009 - 12:29 PM
|
The ProfStudio sample contains many bars similar to Breakpoints bar and they use an inner toolbar window rather than button windows on the dialog surface. As we said before, the toolbars are well updated via MFC’s command updating mechanism.
|
|
Technical Support
|
Aug 4, 2009 - 1:51 AM
|
The CExtControlBar class is designed as a container of one child window only. This child window is always automatically resized to cover the entire control bar’s client area. You should create a child CExtResizableDialog window inside the control bar. The ProfStudio sample application contains many control bars with child container windows, including resizable dialogs.
|
|
Robert Webb
|
Aug 4, 2009 - 12:42 AM
|
On a similar note, how do I load a dialog resource into a control bar? Is it possible to create a CExtResizableDialog as a child of a CExtControlBar? Will there be problems since the CExtResizableDialog wants to be a top level window? If I could do this it would presumably fix my above problem too. Thanks, Rob.
|
|
Technical Support
|
Aug 4, 2009 - 9:15 AM
|
There are no problems with child resizable dialogs created inside control bars. Please create some dialog template resource, remove caption and borders from it, set on its Clip Siblings and Clip Children options and set its type to Child - not Popup, not Resizing. The create the classic C++ dialog class with everything you need and derive it from the CExtResizableDialog class. Then add the main frame’s property like:
CYourDialogClassNameHere m_wndYourDlg;
Then create dialog window as child of some resizable control bar in the main frame’s OnCreate() handler method: if( ! m_wndYourDlg.Create( CYourDialogClassNameHere::IDD, &m_wndSomeExtControlBar ) )
{
ASSERT( FALSE);
return -1;
}
m_wndYourDlg.ShowSizeGrip( FALSE );
That’s all. The resizable dialog is created inside control bar. It’s the child dialog - not popup and not top level.
|
|
Robert Webb
|
Aug 5, 2009 - 9:50 PM
|
Ah, thanks for the excellent and detailed reply. I have it working now. Rob.
|
|
Robert Webb
|
Aug 6, 2009 - 1:32 AM
|
Ah, another question. I have some buttons on my control bar dialog which have the same IDs as other buttons on toolbars elsewhere. My toolbar buttons work, but so far my dialog buttons do not. How can I tell some controls in the dialog to be handled by the main frame instead? That is, when clicked, the message should go to the frame, and the OnUpdate should also be handled by the frame. Would be nice if the tooltips appearing for the toolbar buttons appeared on the dialog buttons too. Thanks, Rob.
|
|
Torsten Schucht
|
Jul 31, 2009 - 3:45 AM
|
This post might be duplicated. I posted this earlier today but it did not show up in the forum. I have got a problem with dynamically creating a CExtNCSB<CListBox>. The debugger stops during the call to Create(). I figured out, that the GetParent() method in NCSB_GetParentWindow() returns a wrong parent. Not the one I passed to the Create() method. Then a crash occurs in NCSB_InstantiateAndCreateContainer() in the call pWnd->Create( pWndParent ). When I create the listbox from a resource, everythin is OK. Only the dynamic creation fails. I have compare all style flags. They are equal. Do you have any idea what the reason for the wrong parent could be?
|
|
Technical Support
|
Aug 2, 2009 - 1:17 PM
|
It looks like you encountered a conflict with MFC’s window creation hooking mechanism. Please configure your CExtNCSB < CListBox > window to use delayed scroll bar initialization. This means you should invoke the constructor of the CExtNCSB class with parameter: CExtNCSB < CListBox > * pYourDynamicListBox = new CExtNCSB < CListBox > ( true );
|
|
Rado Manzela
|
Jul 30, 2009 - 2:11 PM
|
I’m not sure when this happened, maybe after upgrade to .85 or .87 but I’ve noticed that TAB key does not switch me to next property grid item anymore when I press TAB key. Can you check this please? Thank you
|
|
Technical Support
|
Jul 31, 2009 - 7:45 AM
|
We checked both 2.85 and 2.87. The tab key works in both cases. But it works better in 2.87 because the tab key pressed on the last property value switches focus to the next dialog control. Additionally, the tab key in 2.85 does not work with property values which use grid cells without in-place editors such as a check box grid cell.
|
|
Adrian M
|
Jul 30, 2009 - 12:39 PM
|
Hi,
I’m wondering if this control already exists in the Prof-UIS libraries, or if some of its components are already available.
The control allows the user to select multiple items from a list of existing items. It usually consists of two list boxes side by side, the one on the left containing the available items, the other one the selected items. To select items, a >> button is positioned between the two list boxes. There are up/down buttons to specify the order in which items are positioned in the second list. To un-select items, a delete button is also available.
Thanks,
Adrian
|
|
Technical Support
|
Jul 31, 2009 - 7:44 AM
|
The ribbon bar options dialog contains the quick access toolbar customization dialog page with two list boxes, add/remove buttons, move up/down buttons. But we coded it from scratch. We don’t have any control containing such combination of list boxes and buttons because list box items are always very specific in each particular project.
|
|
Jon Ort
|
Jul 29, 2009 - 1:27 PM
|
We have several EXEs that are (to the user) all part of a single application. We want to have a single option for setting the UI theme but all the applications need to share the setting. For each application we have a unique registry key and use PaintManagerStateLoad. What is the appropriate method to share a theme? Should we call PaintManagerStateLoad with the same key or should be call PaintManagerStateLoad with a unique key and then make a call to InstallPaintManager with a specific manager class Thanks Jon
|
|
Technical Support
|
Jul 30, 2009 - 12:42 PM
|
The easiest way is to use the same registry location for paint manager states of all the applications. Changing the current theme in this case is a sequence of the following steps:
1) Changing the current in one of applications through g_PaintManager.InstallPaintManager( . . . ) .
2) Saving the paint manager’s state in the same application through g_PaintManager.PaintManagerStateSave( . . . ) .
3) Notifying all the other running apps to let them load the paint manager state by invoking g_PaintManager.PaintManagerStateLoad( . . . ) . You can use any mechanism for notifying you apps: sending window messages to some windows, using EXE based com server with connection points (all apps should be subscribed to events of these server), using RPC or any other inter process communication.
|
|
VALGOR
|
Jul 27, 2009 - 9:07 PM
|
Dear support
I have a CExtResizableDialog that has a CExtTabPageContainerWnd formed by several CExtResizableDialog
My problem is how can I access this from a CExtResizableDialog in CExtTabPageContainerWnd a main CExtResizableDialog?
CExtResizableDialog m_DialogMain;
CExtTabPageContainerWnd m_MyTab;
CExtResizableDialog m_DialogTab1; CExtResizableDialog m_DialogTab2; CExtResizableDialog m_DialogTab3; CExtResizableDialog m_DialogTab4;
.... Create All; ....
from m_DialogMain I can access without problems to m_MyTab and turn m_DialogTab1, m_DialogTab2, m_DialogTab3, m_DialogTab4 but from m_DialogTab1, m_DialogTab2, m_DialogTab3, m_DialogTab4 How you can access to m_DialogMain?
using GetParent() gives me exception error to execute.
Thank you for your kindness
best regards..
Valentin Spain
|
|
VALGOR
|
Jul 28, 2009 - 6:36 PM
|
|
|
Technical Support
|
Jul 28, 2009 - 8:44 AM
|
You should invoke the GetParent() API two times from any methods of the m_DialogTab*** dialog pages because the first parent is the CExtTabPageContainerWnd window and the second parent is the m_DialogMain window.
void CYourDialogPageClass::SomeMethod()
{
//
// 1st
//
CWnd * pWnd = GetParent();
ASSERT_VALID( pWnd );
ASSERT( pWnd->GetSafeHwnd() != NULL );
ASSERT( pWnd->IsKindOf( RUNTIME_CLASS( CExtTabPageContainerWnd ) ) );
//
// 2nd
//
pWnd = pWnd->GetParent();
ASSERT_VALID( pWnd );
ASSERT( pWnd->GetSafeHwnd() != NULL );
CYourMainDialogClass * pMainDialog = STATIC_DOWNCAST( CYourMainDialogClass, pWnd );
. . .
}
|
|
Rado Manzela
|
Jul 27, 2009 - 9:05 AM
|
I’ve overrided OnTabWndClickedItemCloseButton() in class derived from CExtTabPageContainerFlatWnd. When I display some message box in this method (CExtMsgBox::DoModal) , the 1st mouse click is ignored. So i need 2 clicks to close the message box, or drag dialog’s title to move it. Can you check this please? Thank you.
|
|
Technical Support
|
Jul 27, 2009 - 12:05 PM
|
Thank you for reporting this issue. To fix it, please update the source code for the following method: bool CExtTabWnd::_ProcessMouseClick(
CPoint point,
bool bButtonPressed,
INT nMouseButton, // MK_... values
UINT nMouseEventFlags
)
{
ASSERT_VALID( this );
if( GetSafeHwnd() == NULL )
return false;
if( bButtonPressed )
{
CWnd * pWndTestChildFrame = GetParentFrame();
if( pWndTestChildFrame != NULL && pWndTestChildFrame->IsKindOf( RUNTIME_CLASS( CMDIChildWnd ) ) )
{
CFrameWnd * pWndFrame = pWndTestChildFrame->GetParentFrame();
if( pWndFrame != NULL )
{
CMDIFrameWnd * pWndMDIFrame = DYNAMIC_DOWNCAST( CMDIFrameWnd, pWndFrame );
if( pWndMDIFrame != NULL )
{
CMDIChildWnd * pActive =
pWndMDIFrame->MDIGetActive();
if( pWndTestChildFrame != pActive )
((CMDIChildWnd*)pWndTestChildFrame)->MDIActivate();
}
}
}
} // if( bButtonPressed )
LONG nHitTest = ItemHitTest( point );
switch( nHitTest )
{
case __ETWH_BUTTON_LEFTUP:
case __ETWH_BUTTON_RIGHTDOWN:
case __ETWH_BUTTON_SCROLL_HOME:
case __ETWH_BUTTON_SCROLL_END:
case __ETWH_BUTTON_HELP:
case __ETWH_BUTTON_CLOSE:
case __ETWH_BUTTON_TAB_LIST:
return OnTabWndClickedButton( nHitTest, bButtonPressed, nMouseButton, nMouseEventFlags );
default:
if( nHitTest < __ETWH_TAB_FIRST )
{
OnTabWndMouseTrackingPushedStop();
Invalidate();
UpdateWindow();
return false; //true;
}
break;
}
ASSERT( nHitTest >= 0 && nHitTest < ItemGetCount() );
if( bButtonPressed )
m_ptStartDrag = point;
else
{
if( m_nPushedTrackingButton >= 0 && m_bPushedTrackingCloseButton )
{
CPoint ptCursor;
if( ::GetCursorPos( &ptCursor ) )
{
ScreenToClient( &ptCursor );
if( ItemGet( m_nPushedTrackingButton )->CloseButtonRectGet().PtInRect( ptCursor ) )
{
if( ::GetCapture() == m_hWnd )
::ReleaseCapture();
LONG nPushedTrackingButton = m_nPushedTrackingButton;
OnTabWndClickedItemCloseButton( nPushedTrackingButton );
}
}
return true;
}
}
return OnTabWndClickedItem( nHitTest, bButtonPressed, nMouseButton, nMouseEventFlags );
}
|
|
Torsten Schucht
|
Jul 24, 2009 - 9:21 AM
|
I am integrating ProfUIS into an exisiting MFC application. Now I have encountered a problem with the CExtEdit: The text disapears when I enter the control with the mouse. When I move the mouse very fast onto the control the text does not disapear. I am creating the CExtEdit window at runtime using the CreateEx method, not using resources. The parent window in which the control is displayed is either based on a CMDIChildWnd or on a CExtResizableDialog. The effect of disapearing text only happens when I have the scrollbars enabled (using the WS_HSCROLL | WS_VSCROLL style). I was not able to reproduce this behaviour in a standalone dialog based sample. Do you have any hints how this could happen? Any comment is welcome. Thanks. Torsten
|
|
Technical Support
|
Jul 27, 2009 - 12:07 PM
|
The Date & Time and Date Browser dialog pages in the ProfUIS_Controls sample application have scrollable multi line editor windows at the bottom of dialog page windows. The Date & Time dialog page uses a simple editor common control. The Date Browser dialog page uses a rich edit control. Please compare the styles of these editors with your multiline editor styles. There must be a way to reproduce the problem using the ProfUIS_Controls sample application and it’s hardly possible this problem is related to the MDI interface.
|
|
Torsten Schucht
|
Jul 27, 2009 - 4:47 AM
|
Thanks for your information. I tried to add the recommended styles, but it did not help. I have found a workaround: when I overwrite the OnMouseMove() method in my CExtEdit derived class and do nothing there (which avoids the base class’s OnMouseMove() method to be called) the text does not disappear. To understand the phenomena a bit more, I added a call to CExtEdit::OnMouseMove() and the text disappeared again when entering the control’s client area. By the way: if I just put the mouse cursor on the control’s scrollbars, the text stays visible. When I debug into the CExtEdit::OnMouseMove() I get to CWnd::OnActivate() which calls CWnd::Default() where DefWindowProc() is called with the last message. This last message is usually 512 (WM_MOUSEMOVE) but also has been 133 (WM_NCPAINT). Do you have any idea why this could cause the described behaviour? I would really like to know the reason although the problem seems to be fixed in the first step.
|
|
Technical Support
|
Jul 25, 2009 - 12:07 PM
|
Please check the following:
- The parent window of the edit control should have the WS_CLIPCHILDREN|WS_CLIPSIBLINGS styles.
- If the parent window has any child controls like a group box and a static frame, the Z-order such controls should be greater than the Z-order of any other control including any editor created at run-time.
|
|
tera tera
|
Jul 21, 2009 - 7:28 PM
|
Hello. I maximize Window with a RibbonBar sample.
I execute DirectX or Direct3D in a full-screen mode.
At the time of the full screen end , Maximization of Window of the RibbonBar sample is canceled.
This phenomenon reproduces even XP-Japan and Vista-Japan
I write a reproduction method of the malfunction.
(1), I start RibbonBar.exe.
(2), I maximize Window.
(3), I execute DirectX or Direct3D in a full screen.
A full screen example program ( http://download.cnet.com/Turok-Direct-3D-demo/3000-7441_4-10013197.html )
(4), Malfunction occurs. Give my best regards
|
|
Technical Support
|
Jul 22, 2009 - 12:47 PM
|
Does not occur. Did you try to update your video card drivers?
|
|
tera tera
|
Aug 4, 2009 - 8:28 PM
|
Hello.
I prepared for reproduction environment.
1, Please push the button which a red arrow is shown
2, Please execute screen saver several times
It reappears.
About the Remove environment,
I e-mail it individually.
|
|
Panagiotis Zarafonitis
|
Jul 21, 2009 - 3:53 AM
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <meta content="Word.Document" name="ProgId" /> <meta content="Microsoft Word 11" name="Generator" /> <meta content="Microsoft Word 11" name="Originator" /> <link href="file:///C:\DOCUME~1\Pantelis\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml" rel="File-List" />
<!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning /> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--> <style type="text/css"> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:595.3pt 841.9pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:35.4pt; mso-footer-margin:35.4pt; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style> <!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--> I am using CExtTabPageContainerOneNoteWnd to create several tab pages where the user has to fill some data. Is there a way to integrate a CExtCheckBox on each tab (lets say in the icon area) in order to be checked when the user filled each particular page?<o:p></o:p> <o:p> </o:p> Kind regards<o:p></o:p>
|
|
Panagiotis Zarafonitis
|
Jul 22, 2009 - 10:43 AM
|
Thank you for your quick response. Maybe I wasn’t clear at my initial post. The checkboxes must be fully functional and not just drawings of checks (the user must check each tab after he/she finishes the data input). Can you please provide me with some sample source code because I am still a newbie on your library. Kind regards
|
|
Technical Support
|
Jul 22, 2009 - 1:07 PM
|
|
|
Panagiotis Zarafonitis
|
Jul 23, 2009 - 4:41 AM
|
Thank you very much. The sample code, with minor modifications, worked fine.
Kind regards
|
|
Panagiotis Zarafonitis
|
Jul 22, 2009 - 12:00 AM
|
Thank you for your quick response. Maybe I wasn’t clear at my initial post. The checkboxes must be fully functional and not just drawings of checks (the user must check each tab after he/she finishes the data input). Can you please provide me with some sample source code beacause I am still a newbie on your library. Kind regards
|
|
Technical Support
|
Jul 21, 2009 - 8:47 AM
|
The icon part of the tab item should be used for implementing check box. You can simply use the check box like looking icons. If you need both icons and check boxes, then you should use wide 32x16 icons where left 16x16 part is some image and right 16x16 part is icon like looking image or vice versa.
|
|
Panagiotis Zarafonitis
|
Jul 21, 2009 - 3:55 AM
|
I am using CExtTabPageContainerOneNoteWnd to create several tab pages where the user has to fill some data. Is there a way to integrate a CExtCheckBox on each tab (lets say in the icon area) in order to be checked when the user filled each particular page?
Kind regards
|
|
Neville Franks
|
Jul 20, 2009 - 7:26 PM
|
I am using a static library build of Prof-UIS with a numberof #defines in Prof-UIS.h uncommented to reduce the final .EXE size. I have just upgraded from V2.84 to V2.85 and the .EXE size has increased by 3,219KB or over 3MB for the Release Build. I compared the V2.84 and V2.85 versions of Prof-UIS.h and found two new #defines __EXT_MFC_NO_FORMULA_GRID and __EXT_MFC_NO_GEO_CONTROLS which were not included in the V2.85 // trial/commercial features section of the .h. I have added these and done a complete rebuild but they made little difference. I then went back and did a clean rebuild using V2.84 to verify the increase in code size was correct. I have had a quick look at the .MAP file to see if I could see where all the extra code is coming from but nothing was obvious. I am using VS2008. I don’t want my .EXE to increase by 3MB for no benefit to my users. This is the // trial/commercial features section of my Prof-UIS.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 // Needed for SUL
#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_FORMULA_GRID // NF 21/07/2009
// #define __EXT_MFC_NO_IMAGEEDITWND // Needed for Toolbar Button Image Editor
//#define __EXT_MFC_NO_COLORPALETTE
// #define __EXT_MFC_NO_ICONEDITDLG // Needed for Toolbar Button Image Editor
// #define __EXT_MFC_NO_BUILTIN_TEXTFIELD // Needed for __ECTN_TBB_DATE use!
// #define __EXT_MFC_NO_BUILTIN_DATEFIELD // Required for SUL.
//#define __EXT_MFC_NO_CUSTOMIZE
// #define __EXT_MFC_NO_TAB_PAGECONTAINER_CTRL // Prof-UIS need this!
#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_BROWSER
// #define __EXT_MFC_NO_DATE_PICKER // Needed for SUL.
// #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
#define __EXT_MFC_NO_SHELL
#define __EXT_MFC_NO_SHELL_TREE_VIEW_CTRL
#define __EXT_MFC_NO_SHELL_LIST_VIEW_CTRL
#define __EXT_MFC_NO_SHELL_COMBO_BOX
#define __EXT_MFC_NO_SHELL_EXTENSIONS_COMBO_BOX
#define __EXT_MFC_NO_SHELL_DIALOG_BFF
#define __EXT_MFC_NO_SHELL_DIALOG_FILE
#define __EXT_MFC_NO_GEO_CONTROLS // NF 20/07/2009
// 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_SCROLLCONTAINERWND
//#define __EXT_MFC_NO_SCROLLITEMWND
//#define __EXT_MFC_NO_SCROLLCONAINERWND
// #define __EXT_MFC_NO_SPIN // Need for CExtPaintManager::PAINTTOOLBARTEXTFIELDDATA -> PaintSpinButton()
//#define __EXT_MFC_NO_STATUSBAR
//#define __EXT_MFC_NO_NC_FRAME
//#define __EXT_MFC_NO_PROGRESS_WND
//#define __EXT_MFC_NO_THEME_SWITCHER_TOOLBAR
#define __EXT_MFC_NO_TREE_VIEW_CTRL
#define __EXT_MFC_NO_LIST_VIEW_CTRL
Thanks.
|
|
Neville Franks
|
Jul 22, 2009 - 1:51 AM
|
Thanks. #include "ResGeoControls\\ResGeoControls.rc" added the 3MB, so commenting that out resolved my main issue. Uncommenting the __EXT_MFC_NO_RESOURCES_*** lines saved another 8442KB which is welcome.
|
|
Technical Support
|
Jul 21, 2009 - 8:50 AM
|
Please comment out all unnecessary resources in the ...\Prof-UIS\Include\Resources\resource.rc file. First of all, you can remove unnecessary languages by uncommenting //#define __EXT_MFC_NO_RESOURCES_*** lines. Then you can comment out the following line if you don’t need geographic controls and, as a result, you will save 3 MB: #include "ResGeoControls\\ResGeoControls.rc"
If you don’t need Office 2007 themes, then you can comment the next line and save the next 3MB: #include "Res2007\\Res2007.rc"
|
|
Neville Franks
|
Jul 22, 2009 - 1:52 AM
|
Thanks. #include "ResGeoControls\\ResGeoControls.rc" added the 3MB, so commenting that out resolved my main issue. Uncommenting the __EXT_MFC_NO_RESOURCES_*** lines saved another 8442KB which is welcome. Neville Franks http://www.surfulater.com
|
|
Rado Manzela
|
Jul 9, 2009 - 10:49 AM
|
After switch to 2.85 I’ve noticed bug. When I override CExtTreeGridWnd::OnGbwSelectionChanged(), when I call ItemFocusGet(), it returns previously focused item, not current one. It used to work in older prof-uis.
|
|
Technical Support
|
Jul 12, 2009 - 5:15 AM
|
Yes, the standard tree control makes tree rows selected first (on left mouse button down) and only then focused (on left mouse button up). That’s why we changed behavior of tree grid’s focus/seletion.
|
|
Rado Manzela
|
Jul 11, 2009 - 2:09 PM
|
I need to do something after selection changes, and use current selection and current focus (which is changed by selection change too) which is easier to do on one place. So is it by design of new version to change executing order OnSelection ... and OnFocus() ? Then I’m thinking whether it was necessary to break old code ;)
|
|
Technical Support
|
Jul 11, 2009 - 11:49 AM
|
The answer is hidden in your message. The focus and selection is not the same. If you need to catch the selection changing event, then you should implement the OnGbwSelectionChanged() virtual method. If you need to catch the focus changing event, then you should implement the OnGbwFocusChanged() virtual method.
|
|
VALGOR
|
Jul 7, 2009 - 12:42 PM
|
Dear team suport
I have with CExtGridCell .... I put in a CExtGridWnd with a cell type CExtGridCellCheckBox.... clicking on that cell changes perfectly "on" a "off" and places a text "Sí" and "No"
But my problem is when I press a button to read the value of that cell by means of a CExtButton always puts the same value in my case
INT MyGrid->GetCheck() = 1.
void CMyDlg::OnBnClickedButton1() { // Position cell to load ( but worth every position ) int xx = 1; int yy = 1;
CExtSafeString aa = "";
CExtGridCellCheckBox *pDataCellC = STATIC_DOWNCAST( CExtGridCellCheckBox, m_wndGrid.GridCellGet( xx, yy, 0, 0, RUNTIME_CLASS( ExtGridCellCheckBox ) ) ); if( pDataCellC ) { ASSERT_VALID( pDataCellC );
aa = "false"; if( pDataCellC->GetCheck() ) <-------------- Always = 1 Why???? aa = "true";
AfxMessageBox( aa ); } }
Is there a way to read the cell value correctly outside the CExtGridWnd?
Thank you..
|
|
VALGOR
|
Jul 9, 2009 - 7:27 PM
|
Thank you very much for your help.
|
|
VALGOR
|
Jul 8, 2009 - 4:54 PM
|
Sorry I forgot to put the I initialized of cell type CExtGridCellCheckBox
to read its value pS_DatoC->ModifyStyle(
__EGCS_CHK_CHECK // tiene checkbox
|__EGCS_CHECKED // marca del check a on
|__EGCS_ICA_HORZ_CENTER // horizontal centro
|__EGCS_ICA_VERT_CENTER // vertical medio
);
pS_DatoC->ModifyStyle( __EGCS_NO_INPLACE_CONTROL );
pS_DatoC->SetAutoTextMode( true ); I initialized both to read and to use the same inicialize
|
|
Technical Support
|
Jul 8, 2009 - 10:30 AM
|
We suspect there is something wrong with the check box initialization code. Please show us the complete initialization code of the grid control including filling with grid cells.
|
|
VALGOR
|
Jul 8, 2009 - 3:18 PM
|
// Fill List values cell
void CMyGridSQL::RellenaLista( CSQLResult& res ) { SQLValueArray arrValues; CString strItemText = "", temp = ""; long lValor = 0L;
CExtGridCellString *pS_DatoS = NULL; CExtGridCellVariant *pS_DatoV = NULL; CExtGridCellCheckBox *pS_DatoC = NULL;
long nFila = 0; while( res.Fetch( arrValues, false ) ) { if( !primera ) { RowInsert( -1L );
CExtGridCell *pCellHdr = NULL; pCellHdr = GridCellGetOuterAtLeft( 0L, nFila, RUNTIME_CLASS( CExtGridCellHeader ) ); if( pCellHdr != NULL ) { ASSERT_VALID( pCellHdr ); pCellHdr->ModifyStyle( __EGCS_HDR_FOCUS_ARROW_DISPLAY |__EGCS_HDR_FOCUS_ARROW_RESERVE_SPACE | __EGCS_HDR_ROW_COLUMN_NUMBER | __EGCS_TA_HORZ_RIGHT ); } }
const int nSize = arrValues.GetSize() + 1; for(int nIndex = 0; nIndex < nSize; nIndex++) { if( DatosCabecera[ nIndex ].m_TipoCampo == ’L’ ) { pS_DatoV = STATIC_DOWNCAST( CExtGridCellVariant, GridCellGet( nIndex, nFila, 0, 0, RUNTIME_CLASS(CExtGridCellVariant) ) ); if( pS_DatoV != NULL ) { ASSERT_VALID( pS_DatoV ); pS_DatoV->ModifyStyle( DatosCabecera[ nIndex ].m_Align, 0 );
const CSQLValue& value = arrValues.ElementAt(nIndex); pS_DatoV->_VariantAssign( (long)value, VT_I4 ); } }
if( DatosCabecera[ nIndex ].m_TipoCampo == ’S’ || DatosCabecera[ nIndex ].m_TipoCampo == ’F’ ) { pS_DatoS = STATIC_DOWNCAST( CExtGridCellString, GridCellGet( nIndex, nFila, 0, 0, RUNTIME_CLASS(CExtGridCellString) ) ); if( pS_DatoS != NULL ) { ASSERT_VALID( pS_DatoS ); pS_DatoS->ModifyStyle( DatosCabecera[ nIndex ].m_Align, 0 );
const CSQLValue& value = arrValues.ElementAt(nIndex); strItemText = (LPCTSTR)value; pS_DatoS->TextSet( strItemText ); } } ///////////////////////////// // Use CExtGridCellCheckBox /////////////////////////////
if( DatosCabecera[ nIndex ].m_TipoCampo == ’E’ ) { pS_DatoC = STATIC_DOWNCAST( CExtGridCellCheckBox, GridCellGet( nIndex, nFila, 0, 0, RUNTIME_CLASS( CExtGridCellCheckBox ) ) ); if( pS_DatoC != NULL ) { ASSERT_VALID( pS_DatoC );
pS_DatoC->ModifyStyle( __EGCS_NO_INPLACE_CONTROL ); pS_DatoC->SetAutoTextMode( true ); pS_DatoC->Set3StateMode( false ); pS_DatoC->LabelTextSet( 0, _T(" ") ); pS_DatoC->LabelTextSet( 1, _T("Sí") ); pS_DatoC->SetCheck( 0 ); } } ///////////////////////////// // CExtGridCellCheckBox ///////////////////////////// }
nFila++; }
if( pS_DatoC ) pS_DatoC = NULL;
if( pS_DatoV ) pS_DatoV = NULL;
if( pS_DatoS ) pS_DatoS = NULL; }
// Load Values cell
void CProveedoresForm::OnItemBorMarcados() { ASSERT_VALID( this );
CExtGridCellVariant *pS_DatoV = NULL; CExtGridCellCheckBox *pS_DatoC = NULL;
if( ::ProfUISMsgBox( GetSafeHwnd(), _T("¿Desea borrar los registros marcados?."), _T("*** AVISO ***"), _AVISO | MB_YESNO ) != IDYES ) return;
CExtSafeString sqlStr = ""; CExtSafeString aa = "";
for( register long nFila = 0; nFila < m_wndGrid->GetTotalFilasINT(); nFila++ ) { pS_DatoV = STATIC_DOWNCAST( CExtGridCellVariant, m_wndGrid->GridCellGet( 0, nFila, 0, 0, RUNTIME_CLASS(CExtGridCellVariant) ) ); if( pS_DatoV != NULL ) { ASSERT_VALID( pS_DatoV );
pS_DatoC = STATIC_DOWNCAST( CExtGridCellCheckBox, m_wndGrid->GridCellGet( 10, nFila, 0, 0, RUNTIME_CLASS( CExtGridCellCheckBox ) ) ); if( pS_DatoC != NULL ) { ASSERT_VALID( pS_DatoC );
pS_DatoC->_Initialize(); pS_DatoC->SetAutoTextMode( true );
// Try to read the value int ss = pS_DatoC->GetCheck(); pS_DatoC->TextGet( aa ); AfxMessageBox( aa );
bool bMeIsChecked = ( (dwCellStyle & __EGCS_CHECKED) != 0 ) ? true : false; <--------- Always TRUE if( bMeIsChecked ) { sqlStr.Format( _T("%s %d DELETE FROM %s WHERE Empresa = %s AND Codigo = %ld"), aa, ss, ficheroMySQL, App->m_EmpresaActiva, pS_DatoV->lVal ); // m_wndGrid->DoExecuteSQL( sqlStr ); AfxMessageBox( sqlStr ); } else { sqlStr.Format( _T("%s %d NO Codigo = %ld"), aa, ss, pS_DatoV->lVal ); AfxMessageBox( sqlStr ); }
pS_DatoC->TextGet( aa ); <--------- Always void
if( pS_DatoC->GetCheck() ) <--------- Always 1 { sqlStr.Format( _T("%s DELETE FROM %s WHERE Empresa = %s AND Codigo = %ld"), aa, ficheroMySQL, App->m_EmpresaActiva, pS_DatoV->lVal ); // m_wndGrid->DoExecuteSQL( sqlStr ); AfxMessageBox( sqlStr ); } else { sqlStr.Format( _T("%s NO Codigo = %ld"), aa, pS_DatoV->lVal ); AfxMessageBox( sqlStr ); } } } }
if( pS_DatoV ) pS_DatoV = NULL;
if( pS_DatoC ) pS_DatoC = NULL; }
|
|
Technical Support
|
Jul 9, 2009 - 12:12 PM
|
There are several lines of code like this in your code snippet:
pS_DatoV = STATIC_DOWNCAST( CExtGridCellVariant, GridCellGet( nIndex, nFila, 0, 0, RUNTIME_CLASS(CExtGridCellVariant) ) );
Where nIndex is the column number. You are initializing different grid cell objects depending on some data format returned by the database query. We suspect you tried to access a check box grid cell when it’s really some other type of grid cell. Please use the following code for testing the check box cells in your grid window: //
// This string will contain message text composed to show in the message box.
//
CString strMsgBoxMessage;
//
// Next line of code gets grid cell in the grid. The RUNTIME_CLASS( CExtGridCellCheckBox ) parameter will be used
// for initializing check box cell only if there is no grid cell object initialized yet at the (xx,yy) location.
//
CExtGridCell * pCell = m_wndGrid.GridCellGet( xx, yy, 0, 0, RUNTIME_CLASS( CExtGridCellCheckBox ) );
ASSERT_VALID( pCell );
//
// Next line of code formats the beginning part of text to display in message box.
//
strMsgBoxMessage->Format( _T("The grid cell at (column=%d,row=%d) is the object of the %s class type."), xx, yy, str->GetRuntimeClass()->m_lpszClassName );
//
// If the grid cell is really the check box grid cell, then append additional sentence to the message box text.
// Please note, we used the DYNAMIC_DOWNCAST preprocessor function – not STATIC_DOWNCAST
//
CExtGridCellCheckBox *pDataCellC = DYNAMIC_DOWNCAST( CExtGridCellCheckBox, pCell );
if( pDataCellC != NULL )
{
strMsgBoxMessage += _T("\r\nIt’s really the check box cell and its checked state is ");
if( pDataCellC->GetCheck() != 0 )
strMsgBoxMessage += _T("ON");
else
strMsgBoxMessage += _T("OFF");
strMsgBoxMessage += _T(".");
}
//
// Finally, display the message box.
//
::AfxMessageBox( LPCTSTR(strMsgBoxMessage) );
|
|
Robert Webb
|
Jul 7, 2009 - 2:16 AM
|
Hi, I’m somewhat confused about how to add extra user-customisation capabilities. Our software loads user-defined menus from our own file format. Before using Prof-UIS a user could create their own menu file, load it into the software to see a list of available menus, and drag these menus into the menubar. I’m trying to make this work again using Prof-UIS. I’m over-riding OnCreateCustomizeForm() and have added our own tab, with a list control that shows user-defined menu names. These are not menu items, but whole menus. I’m using g_CmdManager->CmdSetup() to add user-commands to the manager, and creating a tree of CExtCustomizeCmdTreeNode nodes to represent the menu structure. Am I on the right track? The following might be a problem: I am only using CmdSetup() for leaf nodes in the menu structure, ie menu items that actually perform a function, rather than just being submenus. I then fill the list control with items from the CExtCustomizeCmdTreeNode tree. The problem now is that when I drag an item from the list, it immediately hits an assertion because the CExtCustomizeCmdTreeNode nodes representing a menu has ID zero. This is because it’s not a command, but rather a submenu with command nodes under it. I thought it didn’t matter what the ID was for menu items which opened submenus? They are not commands afterall. Do I need to give each one a unique ID as well? Is there a way to avoid that? Thanks,
Rob.
|
|
Technical Support
|
Jul 7, 2009 - 12:26 PM
|
The popup submenu items are also based on command tree nodes in the case of customizable menus. These command tree nodes must have unique command identifiers. These unique command identifiers are required for customization subsystem because it supports resetting any sub menu tree. The unique command identifiers allow you to find the root node of any sub menu in the initial command tree of toolbar or menu bar. It’s not possible to avoid command identifier allocations for popup sub menu items. The command tree nodes of popup sub menu items should be marked with the __ECTN_DYNAMIC_POPUP style and appropriate command descriptions in the command manager should be marked with the CExtCmdItem::StateSetDynamicPopup() method.
|