Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
claude laflamme
|
Aug 8, 2005 - 9:26 AM
|
<!--StartFragment --> Hi, I’m wondering if it is possible to add French Canadian resources? I know that I can do it myself because I got the full source code. But, I’ll have to do it each time I install a new version. By now, I can switch all my application resources to French France but I’ll wait on your answer before taking any actions. bye
|
|
Technical Support
|
Aug 9, 2005 - 4:20 AM
|
You can send us the French Canadian translation so we can include it persistently to the profuisdll project. This is not a problem. We need only the profuisdll.rc file from the .../Prof-UIS/profuisdll/ folder. You can also join our international translation team.
|
|
Mel Sampat
|
Aug 7, 2005 - 3:55 PM
|
I am creating an application with an Outlook 2003 UI based on your PageNavigator sample. On the left pane (inside the Outlook nagivator control), I have a class derived from CExtResizableDialog. This contains a CTreeCtrl (just like your sample). The problem is that when the CTreeCtrl has focus, none of the keyboard shortcuts for the main menu work. For example, if I press Alt-F, the menu won’t open. If I set focus to any other view, the shortcuts work fine. Even your sample seems to be working fine, so I must be missing some simple message handler. Can you help? I don’t know if it matters, but in my CMainFrame, I am handling PreTranslateMessage as follows: BOOL CMainFrame::PreTranslateMessage(MSG* pMsg) { if (m_wndMenuBar.TranslateMainFrameMessage(pMsg)) return TRUE; return CFrameWnd::PreTranslateMessage(pMsg); }
Thanks, -Mel
|
|
Technical Support
|
Aug 8, 2005 - 6:24 AM
|
Could you send us your project so we can fix the problem?
|
|
Saroj Acharya
|
Aug 3, 2005 - 7:25 PM
|
Hi Technical Support, My application is MDI and uses Customization and Tab window for the management of the views within the frame window. I want the window to be closed when the user presses certain function keys. I tried sending WM_CLOSE maeesge to the view from the CMainFRame.cpp function. When WM_CLOSE is sent to the view, it calles the function OnDestroy() of the view but it does not get removed completly from the TAN window. Please note that the window will be removed completly when I click the close (x) button of the window. AM I missing something here ? I am not being able to destroy the view from MDI Tab Frame window. Appreciate your help. Saroj
|
|
Technical Support
|
Aug 4, 2005 - 3:25 AM
|
Dear Saroj,
Both of the following invocations should close the window:
pWnd->DestroyWindow();
pWnd->SendMessage( WM_CLOSE ); In the latter case, a particular window can handle the WM_CLOSE windows message and cancel closing. Clicking the "X" button or "Close" item in the window’s system menu is equal to: pWnd->SendMessage( WM_SYSCOMMAND, SC_CLOSE ); The Prof-UIS menu bar and MDI tab windows also send this system command to the active MDI child frame window when their "X" button is pressed. In any case, we think to detect the source of the problem, we should debug your source code.
|
|
Saroj Acharya
|
Aug 5, 2005 - 9:16 AM
|
Sent you my project and waiting for your response. Thanks, Saroj
|
|
Technical Support
|
Aug 5, 2005 - 9:33 AM
|
Yes, we received your project but we start analyzing it, could you check the following. You should not send the WM_CLOSE message to the view. WM_CLOSE should be sent to the child frame window that contains the view.
|
|
Saroj Acharya
|
Aug 5, 2005 - 12:10 PM
|
It works now. Am I stupid or what ?? Should have known that !! Thanks for your help. Saroj
|
|
Krustys Donuts
|
Aug 2, 2005 - 7:41 AM
|
Hi, I am working on another application where depending upon the combobox selection in a property value, a different set of properties should appear below. For example, the initial view may look like this:
+ Donut properties
Type of donut: (combobox)
If the "type of donut" is changed to "glazed", I’d like the property grid control to look like this:
+ Donut properties
Type of donut: Glazed
Amount of glaze: (combobox)
and if the type is changed to "sprinkles":
+ Donut properties
Type of donut: Sprinkles
Number of sprinkles: (edit box)
Currently, it looks like the only way to do this is to add another category... I assumed this is the case because there’s an ASSERT(FALSE) in the method that would have allowed me to add a property item to another property item... it looks like you can only add items to a category.
Would it be possible to add this feature, or am I pretty much force to do something like this?
+ Donut properties
Type of donut: Sprinkles
+ Sprinkle properties
Number of sprinkles: (edit box)
|
|
Technical Support
|
Aug 3, 2005 - 6:05 AM
|
This feature is already in our TO DO list. The next release of the property grid will allow you to use property values as parent items for other property values. This feature is essential for implementing compound property values like a point, size, rectangle, font and custom field set.
|
|
Krustys Donuts
|
Aug 1, 2005 - 7:40 PM
|
Hi, I’m trying to get my different CExtPropertyStore objects combined so that I can modify their common properties. However, when I call combine and synchronize, all of the properties appear for each store
For example, instead of getting something like:
+ Store properties
Color
Height
I get:
+ Store1
Color
Height
+ Store2
Color
Height
+ Store 3
Color
Height
Essentially, each item whose properties need to be displayed in the property grid control derive from StoreBase, which inherits from CExtPropertyStore. When StoreBase is constructed, it loads the properties for the store, which boils down to calls like this:
CExtPropertyValue* pValue = new CExtPropertyValue( label.c_str());
CExtGridCellComboBox* pData = STATIC_DOWNCAST( CExtGridCellComboBox, pValue->ValueActiveGetByRTC( RUNTIME_CLASS(CExtGridCellComboBox)));
pValue->ValueActiveSet( pData);
Is it obvious what I’m doing wrong?
Furthermore, what is CExtPropertyValueMixed? I’ve got this annoying crash that I’m trying to fix, and I see a call to this class in the call stack, but it’s undocumented.
Do you have any FAQs available yet for working with the property grid control?
|
|
Krustys Donuts
|
Aug 2, 2005 - 2:22 PM
|
Ok, we figured it out. In order for Combine to do what we think it should do, the categories obviously need to have the same name. Whoops!
|
|
Technical Support
|
Aug 3, 2005 - 1:19 PM
|
You are absolutely right. You have 3 categories in the combined result instead of one because source categories have different names. The CExtPropertyValueMixed class is the internal part of the property grid control’s implementation. This class implements the property value which contains pointers to other property values in other property stores. Applying the value to a mixed property value will change all referenced values in other property stores. The CExtPropertyValueMixed class is instantiated during combining two or more property stores into one combined property store.
|
|
David Coleman
|
Aug 1, 2005 - 5:52 AM
|
Is there a simple way to test whether horizontal/vertical scrollbars are visible in a CExtGridWnd? After changing the grid content I need to modify the column widths when the vertical scrollbar is displayed in order to prevent a horizontal scrollbar from also appearing. Thanks, David.
|
|
Technical Support
|
Aug 2, 2005 - 5:24 AM
|
You need to call the OnSwUpdateScrollBars() method of the grid control after changing its content. This will update both scroll bars correctly including their position, mutually enabled state and visibility. You should not care about whether a particular scroll bar is visible or not. The CExtScrollWnd class, which is a base class for CExtGridWnd will do all the dirty work for you automatically. You can also invoke grid’s OnSwDoRedraw() method to repaint the content immediately.
If you do need to get information about the scroll bar, then you should call methods of the CExtScrollWnd class: OnSwHasScrollBar() returns a value that indicates whether the scroll bar is visible or enabled and CExtScrollWnd::ScrollInfo32Get() provides you with all the other scroll bar information.
|
|
Srinivasan Natarajan
|
Jul 28, 2005 - 9:52 PM
|
Hi , i would like to add CExtGridWnd control into a CExtResizableDialog, but the sample code explains about how to add control to the CExtTabPageContainerFlatWnd. I don’t want tab page container, i would like to directly put the control on the CExtResizableDialog itself. hope that you would send the sample code regards sundar cynaptix technologies
|
|
Srinivasan Natarajan
|
Aug 2, 2005 - 7:25 AM
|
Hi, Thanks for the response. I sorted out the issue, i made a mistake by inserting the return statement inside the if condition " if( nRepCnt == 2 ) ". Once i took the return statement outside the loop it works. // if double click //return CExtGridWnd::OnGbwAnalyzeCellMouseClickEvent(nChar, nRepCnt, nFlags, point ); } return CExtGridWnd::OnGbwAnalyzeCellMouseClickEvent(nChar, nRepCnt, nFlags, point ); }
It is suppose to take the default action except double click. Also i made a correction by adding if ( (pCell != NULL) && (!pCell->IsKindOf(RUNTIME_CLASS(CExtGridCellHeader)))) to avoid the procedure gets fired when the user double clicks on the header itself. thanks for the mail. regards sundar
|
|
Srinivasan Natarajan
|
Aug 2, 2005 - 5:16 AM
|
Hi, Thanks for the Code, Now it works fine. But it has disabled the nice feature of SORTING . Now it doesn’t sort when you click on the headers. Hope that you would resolve this issue. thanks & regards sundar
|
|
Technical Support
|
Aug 2, 2005 - 7:11 AM
|
To enable the sorting feature for columns in your grid, just apply the __EGWS_BSE_SORT_COLUMNS style: m_wndGrid. BseModifyStyle( __EGWS_BSE_SORT_COLUMNS, 0 ); If you need the multiple column sorting feature, add the __EGWS_BSE_SORT_MULTIPLE_COLUMNS style instead.
|
|
Technical Support
|
Jul 29, 2005 - 11:17 AM
|
We have sent you a sample project by e-mail. This very simple project demonstrates how to use the grid control in the dialog.
|
|
Simon DESEE
|
Aug 21, 2005 - 10:54 AM
|
Hello, I’m also interested for this sample. Could you send it to me by mail ? Regards, Simon
|
|
Eli Kaczer
|
Sep 15, 2005 - 1:01 PM
|
I just posted this same question, before discovering this post. Please email me the sample too... thanks, Eli
|
|
Technical Support
|
Sep 16, 2005 - 5:16 AM
|
We sent you this sample by e-mail.
|
|
Technical Support
|
Aug 21, 2005 - 11:41 AM
|
We sent you this application by e-mail as you requested.
|
|
Srinivasan Natarajan
|
Jul 31, 2005 - 11:00 PM
|
Hi, Thanks for the Code, By the way is there any way to have a double click method on the grid ( like listctrl control) ? Thanks for the reply. expecting your reply regards sundar
|
|
Technical Support
|
Aug 1, 2005 - 5:35 AM
|
The CExtGridWnd class was not conceived as a replacement for the CListView class. But it is possible to handle double click events in your CExtGridWnd -derived class. You need to override the CExtGridWnd::OnGbwAnalyzeCellMouseClickEvent() method like as follows: bool C_YOUR_GridWnd::OnGbwAnalyzeCellMouseClickEvent(
// the nChar parameter:
// VK_LBUTTON, VK_RBUTTON or VK_MBUTTON only
UINT nChar,
// the nRepCnt parameter:
// 0 - button up, 1 - single click, 2 - double click,
// 3 - post single click & begin editing
UINT nRepCnt,
// the nFlags parameter:
// mouse event flags
UINT nFlags,
// the point paramerter
// mouse pointer in client coordinates
CPoint point
)
{
ASSERT_VALID( this );
if( nRepCnt == 2 )
{ // if double click
CExtGridHitTestInfo htInfo( point );
HitTest( htInfo, false, true );
if( ( ! htInfo.IsHoverEmpty() )
|| htInfo.IsValidRect() )
{ // if some cell clicked
} // if some cell clicked
INT nColType = htInfo.GetInnerOuterTypeOfColumn();
INT nRowType = htInfo.GetInnerOuterTypeOfRow();
CExtGridCell * pCell =
GridCellGet(
htInfo.m_nColNo,
htInfo.m_nRowNo,
nColType,
nRowType
);
if( pCell != NULL )
{
ASSERT_VALID( pCell );
// TO DO:
// you should return true here if your code
// has handled the double click event
}
} // if double click
return
CExtGridWnd::
OnGbwAnalyzeCellMouseClickEvent(
nChar, nRepCnt, nFlags, point );
}
|
|
Thomas Zaenker
|
Jul 28, 2005 - 2:17 AM
|
Dear support team, the downloaded zip achive of version 2.42 seems corrupt. Can I have the background of a palette menu like the background of a toolbar (with gradient) to have a consistent appearance. Maybe it is already done in version 2.42 but was not in version 2.41 by default. Best regards, Axel
|
|
Technical Support
|
Jul 28, 2005 - 1:00 PM
|
We repacked Prof-UIS 2.42 with another version of the archiver and uploaded it to our website. The exact file size is now 4399541 bytes. Please try to download it again.
The palette menu has a background of the ordinary menu without its left icon area. It looks like palette menus in Microsoft applications.
The background of the floating toolbar is solid in XP/2K themes. It is based on per-row gradients in 2003/2005 styles. This is not supported by the palette menu. Besides, this idea can not be coded because floating toolbars in 2003/2005 are hiding horizontal separators that is required for well looking gradients under each row with buttons. The palette menu does not hide separators and this is needed in several cases.
By the way, we are ready to continue this discussion and provide you with the palette menu like you need.
|
|
Mel Sampat
|
Jul 28, 2005 - 2:11 AM
|
I am building a UI similar to Outlook 2003 by following your sample. The navigation control is working great! Next, I want to create the middle portion of Outlook UI, where the messages or items are displayed. At the top of that portion, a title has to be displayed (e.g. "Inbox", "Notes", "Calendar" etc). How do I use Prof UIS to display such a gradient caption on top of a list view control? You are already using it at the top of the Outlook Navigation control, so I’m wondering if the gradient text control can be used independantly. Thanks.
|
|
Technical Support
|
Jul 28, 2005 - 9:26 AM
|
If you are using the PageNavigator application for your new project AS IS, then you can simply draw the caption at the top of the CChildView area. Here is the updated source code for the CChildView::OnPaint() method: void CChildView::OnPaint()
{
CRect rcClient;
GetClientRect( &rcClient );
CPaintDC dcPaint( this );
CExtMemoryDC dc( &dcPaint, &rcClient );
dc.FillSolidRect(
rcClient,
g_PaintManager->GetColor(
COLOR_WINDOW,
(CObject*)this
)
);
g_PaintManager->PaintResizableBarChildNcAreaRect(
dc,
rcClient,
this
);
CRect rcCaption = rcClient;
rcCaption.bottom = rcCaption.top + 25;
CExtSafeString sCaption = _T("PageNavigator");
g_PaintManager->PaintPageNavigatorItemCaption(
dc,
rcCaption,
sCaption
);
g_PaintManager->PaintResizableBarChildNcAreaRect(
dc,
rcCaption,
this
);
} The caption over the main view area can be implemented as a separate window and we can code it for you. In this case we need the exact description of your application layout.
|
|
Mel Sampat
|
Jul 28, 2005 - 10:48 AM
|
Thank you, that worked great! One more question: In this line: rcCaption.bottom = rcCaption.top + 25; The value 25 is hard coded. Is it also hard coded in the ProfUIS library? If not, is there a way to dynamically obtain the title bar’s height instead of hard coding? Thanks!
|
|
Technical Support
|
Jul 28, 2005 - 1:19 PM
|
Value 25 is equal to (24+1) with 1 being the top border width of the CChildView window and 24 being the value returned by the CExtPageNavigatorWnd::OnQueryItemCaptionHeight() virtual method which should be used in computations instead of the hard-coded value 25. We noticed that the height of the gradient caption in MS Outlook is equal to 24 regardless of any conditions.
|
|
William Keadey
|
Jul 26, 2005 - 11:08 AM
|
I have two problems. 1. I have certain control bars where I don’t want the right click menu that lists all the control bars in my application to appear. 2. When I create a dynamic docking window. It shows up in the right click menu, but is disabled. I do not want it to appear in the menu at all.
|
|
Technical Support
|
Jul 27, 2005 - 8:52 AM
|
We assume you are using dynamic resizable control bars (the CExtDynamicControlBar class) which are managed by the dynamic bar site (the CExtDynamicBarSite class). To customize context menus of particular bars, you need to use your own CExtDynamicControlBar -derived class. Your dynamic control bar should override the CExtDynamicControlBar::OnInitDbsMenu() and return false . This will suppress the menus as you requested. To make the dynamic bar site create the control bars of your type, override its CExtDynamicBarSite::OnDbsCreateNewBarInstance() method which should simply return newly created bars of your class.
|
|
William Keadey
|
Jul 28, 2005 - 6:16 AM
|
I’m actually using CExtControlBar. I changed my derived class to one of CExtDynamicControlBar and did what you had said. If you return false in OnInitDbsMenu the CExtDynamicControlBar Class ASSERTS. I’m not trying to suppress that menu. Now I have a CExtDynamicControlBar derived class that has a dialog on it. The dialog has a series of controls. When I right click on any of the ctrls or on the control bar itself I get a menu that lists all the menu bars, control bars, and so on. I do not want this menu or would like to modify the behavior of this menu. This is same menu that occurs when you right click up in the frame area between menu and my view area.
|
|
Technical Support
|
Jul 28, 2005 - 1:24 PM
|
Now things become clearer. You should simply handle the WM_CONTEXTMENU message in your dialog and make the OnContextMenu() method’s body empty. This solution is based on the WM_CONTEXTMENU message behavior. If it is not processed by some window, the message is sent to the parent window and so on up to the topmost pop-up window. You should also handle this message in your main view window. If your last explanation is correct, then you really don’t need dynamic control bars. The assertion relating to the CExtDynamicControlBar problem can be discussed in details. Do you use the CExtDynamicBarSite class as a second base class in your main frame window. Do you invoke the CExtDynamicBarSite::BarAlloc() method for creating dynamic resizable control bars?
|
|
David Coleman
|
Jul 26, 2005 - 6:04 AM
|
Hello, I am having a problem with the CExtGridWnd::RowInsert() function in that it doesn’t appear to be inserting a new row when I tell it to!!! Let me explain the scenario. My application first starts up with a splitter window containing a grid on the left and other program controls on the right. This grid is working absolutely fine. At a certain point in the program I then attempt to open up a new CMdiChildWnd also with a splitter window and containing another grid on the left and other program controls on the right. For some strange reason the RowInsert function is failing on this second window!!! I have confirmed this by call RowCountGet() which returns -1. The grid is definitely being initialised correctly as all the column headers are being displayed - I just can’t seem to insert any rows!!! Can you offer any advice as to why this may not be working as expected??? Regards, David.
|
|
Technical Support
|
Jul 26, 2005 - 6:59 AM
|
The CExtGridWnd::RowCountGet() method returns a greater or equal to zero number of rows for the grid window which completely manages a two dimensional array of CExtGridCell objects in the application memory. That is the default behavior of the CExtGridWnd class. The CExtGridWnd::RowCountGet() method returns a negative value in the two cases that follow. First, the vertical scrolling strategy is set to virtual (__ESIW_ST_VIRTUAL ). The virtual scrolling permits the thumb button to be only at the home, middle, or end position. This scrolling mode used for working with data of an unknown number of rows and/or columns. The AdoRecorsetView sample application allows you to browse database records in the virtual mode. The virtual scrolling mode requires a custom data provider component to be created and attached to the grid window. If you do not use the virtual scrolling and custom data providers in your application, then we may guess your code simply initializes the grid window incorrectly by specifying some invalid style flags. You may send us your project so that we can clarify the problem.
|
|
David Coleman
|
Jul 26, 2005 - 10:11 AM
|
I am populating the grid in the OnInitialUpdate() on both child windows. The code is very similar in structure and so there is no logical reason as to why it should work fine on the first and not on the second! Please give me a more logical answer with which I can actually make progress...
|
|
Technical Support
|
Jul 26, 2005 - 11:52 AM
|
We just explained what may mean a negative value returned from the CExtGridWnd::RowInsert() . To provide you with a problem solution, we need more details about your application. Debugging your project is the most convenient way for us. At least, we need to take a look at the source code of the OnInitDialog() method which initializes the grid window that causes the problem.
|
|
David Coleman
|
Jul 27, 2005 - 3:56 AM
|
Unfortunately I cannot provide the entire code for the application but I have included below the relevant code snippets relating to the grid definition and initialisation. Hope this helps, David. // --- CHistoryGrid class definition
CHistoryGrid::CHistoryGrid() : m_nBkType( 1 ) { HoverEventsSet(true, true); HoverHighlightSet(true,false,false,false,true,false); SiwModifyStyleEx( __EGWS_EX_PM_COLORS //|__EGBS_EX_CELL_TOOLTIPS_OUTER |__EGBS_EX_CELL_EXPANDING_INNER, 0, false ); } // --- Relevant CHistoryGrid functions void CHistoryGrid::SetCellHeader(long colNo, CString text, long width, long style) { CExtGridCellHeader * pCell = STATIC_DOWNCAST( CExtGridCellHeader, GridCellGetOuterAtTop( colNo, 0L, RUNTIME_CLASS(CExtGridCellHeader) ) ); pCell->ExtentSet(width); pCell->TextSet(text); pCell->ModifyStyle(style, 0); } void CHistoryGrid::SetCell(long colNo, long rowNo, CString text, long style, CString data) { CHistoryCell* pCell = STATIC_DOWNCAST( CHistoryCell, GridCellGet(colNo,rowNo,0,0,RUNTIME_CLASS(CHistoryCell)) ); if(pCell != NULL) { if(!text.IsEmpty()) pCell->TextSet(text); pCell->ModifyStyle( style ); if(!data.IsEmpty()) pCell->m_Data = data; } } void CHistoryGrid::SetCell(long colNo, long rowNo, CString text, COLORREF textColour, COLORREF bgndColour, long style, CString data) { CHistoryCell* pCell = STATIC_DOWNCAST( CHistoryCell, GridCellGet(colNo,rowNo,0,0,RUNTIME_CLASS(CHistoryCell)) ); if(pCell != NULL) { if(!text.IsEmpty()) pCell->TextSet(text); if(textColour != NULL) pCell->m_TextColour = textColour; if(bgndColour != NULL) pCell->m_BgndColour = bgndColour; pCell->ModifyStyle( style ); if(!data.IsEmpty()) pCell->m_Data = data; } } // --- Grid DDX control mapping in HistoryReportView.cpp: DDX_Control(pDX, IDC_HISTORY_LIST, m_Grid); // --- Grid definition in HistoryReportView.h: CHistoryGrid m_Grid; // --- Grid initialisation void CHistoryReportView::OnInitialUpdate() { CFormView::OnInitialUpdate(); // CMyApp* pApp = (CMyApp*)AfxGetApp(); CMainFrame* pMainFrame = (CMainFrame*)AfxGetMainWnd(); CString sTemp; CString sTemp2; CTime* cTime; CTimeSpan* cTimeSpan; CTimeSpan* cTimeSpan2; CTimeSpan* cTimeSpan3; CTimeSpan* cTimeSpan4; SYSTEMTIME sysTime; COleDateTime* vDateTime; COleDateTime* vDateTime1; COleDateTime* vDateTime2; CString sTime; CString sDateTime, sDateTime2; CString sOldDate, sNewDate; CTime* cDateTime; CTime* cDateTime2; CTimeSpan cJourneyTimeSpan; CString sJourneyDuration; CTimeSpan cStopTimeSpan; CString sStopDuration; CString sDate, sDate2; CString sSpeed; CString sHeading; CString sLocation; CString sDistance; CString sDuration; CString sDurationDays, sDurationHours, sDurationMins, sDurationSecs; double dSpeed; double dDistance; CString columnName; long iItem; int iIndex = -1; int iTemp; float fSpeedDivider; float fDistanceDivider; // if(pApp->m_MeasurementUnits == "Miles") { fSpeedDivider = 2.23694f; fDistanceDivider = (0.6214f / 1000); } if(pApp->m_MeasurementUnits == "Kilometres") { fSpeedDivider = 3.6f; fDistanceDivider = (1.0f / 1000); } // m_HistoryReportType = pMainFrame->m_HistoryReportType; m_ReportData = pMainFrame->m_ReportData; m_RecordCount = 0; m_UserEarliestDate = pMainFrame->m_UserEarliestDate; m_UserEarliestTime = pMainFrame->m_UserEarliestTime; m_UserLatestDate = pMainFrame->m_UserLatestDate; m_UserLatestTime = pMainFrame->m_UserLatestTime; m_UserID = pMainFrame->m_UserID; m_UserName = pMainFrame->m_UserName; m_UserESN = pMainFrame->m_UserESN; m_UserIconFile = pMainFrame->m_UserIconFile; // set grid styles m_Grid.SiwModifyStyle( __ESIS_STH_PIXEL //|__ESIS_STV_ITEM //|__EGBS_SFM_FULL_ROWS //|__EGBS_NO_HIDE_SELECTION |__EGBS_GRIDLINES ,__ESIW_ST_VIRTUAL, false ); // initialise list columns m_Grid.OuterRowCountTopSet( 1L, false ); columnName.LoadString(IDS_COLUMN_DATE); m_Grid.ColumnAdd(1, false); m_Grid.SetCellHeader(0, columnName, 120, __EGCS_TA_HORZ_CENTER); // m_Grid.ColumnAdd(5, false); columnName.LoadString(IDS_COLUMN_LOCATION); m_Grid.SetCellHeader(1, columnName, 130, 0); columnName.LoadString(IDS_COLUMN_SPEED); m_Grid.SetCellHeader(2, columnName, 60, __EGCS_TA_HORZ_CENTER); columnName.LoadString(IDS_COLUMN_I1); m_Grid.SetCellHeader(3, columnName, 30, __EGCS_TA_HORZ_CENTER); columnName.LoadString(IDS_COLUMN_I2); m_Grid.SetCellHeader(4, columnName, 30, __EGCS_TA_HORZ_CENTER); columnName.LoadString(IDS_COLUMN_I3); m_Grid.SetCellHeader(5, columnName, 30, __EGCS_TA_HORZ_CENTER); // m_Grid.RowRemoveAll(); m_SelectedItem = -1; if(m_UserID != 0) { if(m_UserEarliestDate != "" && m_UserLatestDate != "") { sTemp.Format("SELECT * FROM [History] WHERE [UserID]=%ld AND (DateValue([FixDateTime]) BETWEEN #%s# AND #%s#) ORDER BY [FixDateTime]", m_UserID, m_UserEarliestDate, m_UserLatestDate, ); } else { sTemp.Format("SELECT * FROM [History] WHERE [UserID] = %ld ORDER BY [FixDateTime]", m_UserID); } // // --- Display History Report --- // initialise recordset pApp->m_rsODBC_History->m_strSort = ""; pApp->m_rsODBC_History->m_strFilter = ""; pApp->m_rsODBC_History->Open(AFX_DB_USE_DEFAULT_TYPE, sTemp); // fill list ctrl from database if(!pApp->m_rsODBC_History->IsEOF()) { iItem = 0; pApp->m_rsODBC_History->MoveFirst(); while(!pApp->m_rsODBC_History->IsEOF()) { cTime = new CTime(); cTime = &(pApp->m_rsODBC_History->m_FIXDATETIME); sDate = cTime->Format("%d/%m/%Y %H:%M:%S"); // if(pApp->isHistoryInRange(cTime, m_ReportData)) { m_Grid.RowInsert(iItem, 1, false); //m_Grid.RowAdd(1, false); //sTemp.Format("Rows: %ld", m_Grid.RowCountGet()); //AfxMessageBox(sTemp, MB_OK, 0); dSpeed = (double)(pApp->m_rsODBC_History->m_SPEED); dSpeed *= fSpeedDivider; sSpeed.Format("%3.2f", dSpeed); sTemp.Format("%ld",pApp->m_rsODBC_History->m_ID); // set date m_Grid.SetCell(0L, iItem, sDate, 0, sTemp); sLocation = pApp->m_rsODBC_History->m_LOCATION; // set speed m_Grid.SetCell(1L, iItem, sLocation, 0, ""); // set location m_Grid.SetCell(2L, iItem, sSpeed, 0, ""); // set speed if(pApp->m_rsODBC_History->m_INPUTS & 0x2) // set input #1 m_Grid.SetCell(3L, iItem, "Off", RGB(255,255,255), RGB(255,0,0), 0, ""); else m_Grid.SetCell(3L, iItem, "On", RGB(255,255,255), RGB(0,255,0), 0, ""); if(pApp->m_rsODBC_History->m_INPUTS & 0x4) // set input #2 m_Grid.SetCell(4L, iItem, "Off", RGB(255,255,255), RGB(255,0,0), 0, ""); else m_Grid.SetCell(4L, iItem, "On", RGB(255,255,255), RGB(0,255,0), 0, ""); if(pApp->m_rsODBC_History->m_INPUTS & 0x8) // set input #3 m_Grid.SetCell(5L, iItem, "Off", RGB(255,255,255), RGB(255,0,0), 0, ""); else m_Grid.SetCell(5L, iItem, "On", RGB(255,255,255), RGB(0,255,0), 0, ""); // iItem++; m_RecordCount++; } // pApp->m_rsODBC_History->MoveNext(); } } // Close ODBC recordset try { pApp->m_rsODBC_History->Close(); } catch (CDBException* e) { //AfxMessageBox(e->m_strError, MB_OK, 0); pApp->WriteError(e->m_strError); e->Delete(); } // ---------------- // m_Grid.ShowWindow(SW_SHOW); CWnd::RepositionBars( 0, 0xFFFF, IDC_HISTORY_LIST); m_Grid.OnSwUpdateScrollBars(); m_Grid.OnSwDoRedraw(); }
|
|
Technical Support
|
Jul 27, 2005 - 8:57 AM
|
Here is the code snippet from your message: m_Grid.SiwModifyStyle(
__ESIS_STH_PIXEL
//|__ESIS_STV_ITEM
//|__EGBS_SFM_FULL_ROWS
//|__EGBS_NO_HIDE_SELECTION
|__EGBS_GRIDLINES
,__ESIW_ST_VIRTUAL, false
); Please uncomment the __ESIS_STV_ITEM flag in it. We recommend you specify the scrolling strategies explicitly.
|
|
David Coleman
|
Jul 27, 2005 - 9:36 AM
|
I have changed the code snippet above to: m_Grid.SiwModifyStyle( __ESIS_STH_PIXEL |__ESIS_STV_ITEM //|__EGBS_SFM_FULL_ROWS //|__EGBS_NO_HIDE_SELECTION |__EGBS_GRIDLINES ,__ESIS_STV_VIRTUAL,false ); as suggested but still no success! The row count is still being returned as -1 and no rows are added! Interestingly if I move all the initialisation code to the OnCreate function the row count increases as new rows are added but the grid is not displayed - not even the header cells! Why does it work fine on one child window and not another??? Regards, David.
|
|
Technical Support
|
Jul 27, 2005 - 1:46 PM
|
At this point we see two ways to solve this problem: A) You will send us source code of the class that creates the grid control and initializes it unsuccessfully. B) You will contact us by e-mail or phone call so that we can arrange a web conference which will allow us to fix the problem without sending us any source code.
|
|
David Coleman
|
Jul 28, 2005 - 9:08 AM
|
After closer inspection I’ve tracked down and corrected the problem :) For some reason on the second child window I had used: __ESIW_ST_VIRTUAL instead of __ESIS_STV_VIRTUAL I corrected this and it now works as expected! David.
|
|
David Coleman
|
Jul 28, 2005 - 3:46 AM
|
Please advise as to how we can setup a web conference
|
|
Technical Support
|
Jul 28, 2005 - 9:07 AM
|
We sent you instructions on the issue of remote debugging by e-mail.
|
|
David Coleman
|
Jul 28, 2005 - 9:09 AM
|
<TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=4 width="100%" border=0> <TBODY> <TR id=_ctl13_Buttons> <TD class=forum_line3 align=right> Reply </TD></TR> <TR> <TD class=forum_line3 id=_ctl13_MessageText>
After closer inspection Iāve tracked down and corrected the problem :) For some reason on the second child window I had used: __ESIW_ST_VIRTUAL instead of __ESIS_STV_VIRTUAL I corrected this and it now works as expected! David. </TD></TR></TBODY></TABLE>
|
|
Technical Support
|
Jul 28, 2005 - 1:10 PM
|
You are absolutely right and we are sorry that we did not find this tipe at once. The __ESIW_ST_VIRTUAL constant is really not a style flag. It is defined for use with the CExtScrollItemWnd::SiwScrollTypeHGet() , CExtScrollItemWnd::SiwScrollTypeHSet() , CExtScrollItemWnd::SiwScrollTypeVGet() and CExtScrollItemWnd::SiwScrollTypeVSet() methods.
|
|
Eddie Judson
|
Jul 26, 2005 - 2:22 AM
|
A quick question, How do I go about displaying multiline CExtGridCellStringDM grid cells? And will the rows automatically stretch to the cell height? Regards, Eddie
|
|
Technical Support
|
Jul 26, 2005 - 6:46 AM
|
All the string cells in the grid window are designed to be single-line. So, you need to use your own cell class and override the CExtGridCell::OnQueryDrawTextFlags() virtual method, which should invoke the parent method to retrieve the default text flags and remove the DT_SINGLELINE flag from the returned value. You also need to override the CExtGridCell::OnMeasureTextSize() virtual method, which measures the text. That is enough to get multiline text in the cells. The CExtGridCell::OnInplaceControlCreate() virtual method can also be overridden to apply the ES_MULTILINE style to the in-place editor window created by default. To make the row height variable, you have to define at least one row header and insert the CExtGridCellHeader object into it. This is essential because the grid uses header cells for keeping row widths and column heights. To hide the header column, set its width to zero with the CExtGridWnd::OuterColumnWidthSet() method. The CExtGridCell::ExtentSet() method invoked for the header cell in the header column allows you to set the minimum, maximum and active row height. If all the heights are equal to each other, then the row is not enabled for resizing. Finally, to change the row height when editing is complete, please override the CExtGridCell::OnInplaceControlTextInputComplete() virtual method of the cell class used in data cell area, measure all the cells in the same row, set the row height in the header and invoke the CExtGridWnd::OnSwUpdateScrollBars() method.
|
|
Eddie Judson
|
Jul 24, 2005 - 7:37 PM
|
Hi, I changed the CMainApp::InitInstance() in the prof-uis controls sample application to the following:
if ( m_pszProfileName != NULL )
free( ( void*)m_pszProfileName );
m_pszProfileName =
_tcsdup( _T("ProfUIS_Controls") );
ASSERT( m_pszProfileName != NULL );
VERIFY(
g_CmdManager->ProfileSetup(
m_pszProfileName
)
);
CMainDlg* pdlg=NULL; #ifdef _DEBUG
CMemoryState oldMemState, newMemState, diffMemState;
oldMemState.Checkpoint(); #endif
pdlg= new CMainDlg();
m_pMainWnd = pdlg; int nResponse = pdlg->DoModal(); if (nResponse == IDOK)
{ // TODO: Place code here to handle when the dialog is // dismissed with OK
} else if (nResponse == IDCANCEL)
{ // TODO: Place code here to handle when the dialog is // dismissed with Cancel
} delete pdlg;
pdlg=NULL;
#ifdef _DEBUG
newMemState.Checkpoint(); if( diffMemState.Difference( oldMemState, newMemState ) )
{
TRACE( "Memory leaked!\n" );
diffMemState.DumpStatistics();
diffMemState.DumpAllObjectsSince();
} #endif // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application’s message pump. return FALSE; and ran it in debug mode, could you tell me how I can clean up properly as I am getting:
Memory leaked!
0 bytes in 0 Free Blocks.
12 bytes in 1 Normal Blocks.
36 bytes in 1 CRT Blocks.
0 bytes in 0 Ignore Blocks.
0 bytes in 0 Client Blocks.
Largest number used: 42589 bytes.
Total allocations: 137760 bytes
Regards,
Eddie
|
|
Technical Support
|
Jul 25, 2005 - 6:38 AM
|
There are no memory leaks in the ProfUIS_Controls sample application. The un-allocated block in the memory dump listed in your message will be de-allocated later during the application shutdown. This block is used by the internal API of the CExtHookSink class which is used by the CExtMenuControlBar class.
|
|
Eric Houvenaghel
|
Aug 31, 2006 - 12:50 PM
|
I too am having memory leaks. Many of them. Thye look like the following:
Data: <{ > 7B C6 12 00 C:\Program Files\FOSS Software Inc\Prof-UIS\Src\ExtHook.cpp(579) : {41022} normal block at 0x01EDAC58, 29 bytes long. Data: < 3 > CC D4 82 33 01 C0 AC ED 01 01 00 00 00 01 00 00 afxtempl.h(330) : {41021} normal block at 0x01EDAC10, 4 bytes long.
I thought I would run it by you before I start debuging this.
|
|
Technical Support
|
Sep 1, 2006 - 5:32 AM
|
This typically means nothing is deallocated at all and, if you set a break point in the destructor of the main frame/dialog window, it will never be invoked in the debug mode. Please try debugging the deinitialization sequence and find out when and why the application terminates. This can be either an unhandled exception or an invocation of the ExitProcess() API.
|
|
Eric Houvenaghel
|
Sep 6, 2006 - 11:42 AM
|
All destructors are invoked. First of all, these memory leaks are comming from the CExtTabPageContainerWnd which derives from CExtHookSink. Here is the situation. I have a dialog containing a tab control. This tab control is derived from CExtTabPageContainerWnd. Using the PageInsert method, I insert my tab dialogs. For debuging purpouses I’ve remove all tabs except for one. So I now have a dialog with a tab control contianing one tab. Inside this tab there is a dialog containing 3 edit contorls. These edit controls are derived from CExtEdit. All dialog were created in the resource manager. The tab control is subclassed using DDX_Control(pDX, TABID, m_tabCtrl); The edit boxes are subclassed using the MFC SubclassWindow function. Now if I open this dialog and close it, and close my application, I get three memory leaks in my dump. It seems to be one memory leak for each edit control (destructor is called in the edit control).
umping objects -> afxtempl.h(330) : {19997} normal block at 0x01F00050, 4 bytes long. Data: <_ > 5F 93 EF 01 C:\Program Files\FOSS Software Inc\Prof-UIS\Src\ExtHook.cpp(579) : {19996} normal block at 0x01EFFFE8, 29 bytes long. Data: < B3 P > CC C4 42 33 01 50 00 F0 01 01 00 00 00 01 00 00 afxtempl.h(330) : {19993} normal block at 0x01EFFEF0, 4 bytes long. Data: <_ > 5F 93 EF 01 C:\Program Files\FOSS Software Inc\Prof-UIS\Src\ExtHook.cpp(579) : {19992} normal block at 0x01EFFE88, 29 bytes long. Data: < B3 > CC C4 42 33 01 F0 FE EF 01 01 00 00 00 01 00 00 afxtempl.h(330) : {19989} normal block at 0x01EFFD90, 4 bytes long. Data: <_ > 5F 93 EF 01 C:\Program Files\FOSS Software Inc\Prof-UIS\Src\ExtHook.cpp(579) : {19988} normal block at 0x01EFFD28, 29 bytes long.
On line 139 in CExtHook there is the following code:
if( bDelete ) delete this;
If I put a break point on the line "delete this", I miss 3 hit. Any help would be appreciated.
|
|
Technical Support
|
Sep 7, 2006 - 12:42 PM
|
We have similar tab pages in the ProfUIS_Controls sample and we do not see any leak there. So, we can guess this depends on some conditions specific to your project only. Could you create a lightweight version of your project which generates leaks and send it to us?
|
|
Eric Houvenaghel
|
Sep 8, 2006 - 10:12 AM
|
|
|
Stephan Finkler
|
Jul 21, 2005 - 2:30 AM
|
Hi,
is it possible to change the font of toolbar button?
|
|
Technical Support
|
Jul 21, 2005 - 6:55 AM
|
The most Prof-UIS classes use the g_PaintManager->m_FontNormal font stored in the global paint manager component. This allows you to easily change the entire GUI font. This is demonstrated in the FunnyBars sample application. To change the font of a particular toolbar button, create a new CExtBarButton -derived class and override both CExtBarButton::CalculateLayout() and CExtBarButton::Paint() virtual methods. In the FunnyBars application, the CFunnyToolButton class implements mouse hover effects and paints underlined colored text. We need more details on what you need to do so that we can help you.
|
|
Saroj Acharya
|
Jul 18, 2005 - 9:02 AM
|
Hi tech Support, I want to disable the docking markers from my application. How would I do that ? All my control bars are floating and should expand between two monitors. I do not want to show the docking markers when the user moves the control bars around. Appreciate your help. Saroj
|
|
Technical Support
|
Jul 18, 2005 - 1:15 PM
|
You can use the Visual Studio 2005 UI theme without docking markers. Just invoke the following code:CExtControlBar::g_eResizablePanelDockingType =
CExtControlBar::__RESIZABLE_DOCKING_TYPE_STUDIO_2003;
|
|
Saroj Acharya
|
Jul 19, 2005 - 10:20 AM
|
|
|
Chris Thomas
|
Jul 18, 2005 - 7:56 AM
|
I’ve got a toolbar button that has an attached popup menu. It has a mysterious delay of 1-2 seconds between clicking on a menu item and hitting a breakpoint in the menu item handler. I tracked it down to CExtBarButton::OnTrackPopup(). It looks like the delay is within that routine, between the call to pPopup->TrackPopupMenu() and getting the clicked command id. After that, things are fast.
Any ideas on what to look for or what I can try?
Thanks
|
|
Technical Support
|
Jul 18, 2005 - 1:14 PM
|
We need more details about your project and the problem. Does the problem exist in Prof-UIS sample applications when you run them? Do you use custom painted menu items and your code loads some resources during the painting? Does your project implement any features that can eat CPU time?
|
|
Jonas Gauffin
|
Jul 16, 2005 - 2:59 AM
|
I have a SDI app. On the toolbar I got a button with id ID_PLAY_NEXT.
I also have a ControlBar with a Dialog in it. In the dialog I try to catch the command ID_PLAY_NEXT with ON_COMMAND(ID_PLAY_NEXT, OnPlayNext). It do not work. However, if I do exactly the same in CMainFrame it do work. How can I catch it in the child dialog?
Another question. How do I use a hottrack bitmap for the toolbar?
|
|
Technical Support
|
Jul 16, 2005 - 9:32 AM
|
You should call the SetOwner() method of your toolbar in the dialog and specify a pointer to the dialog object. This will tell the toolbar window to send command messages to the dialog window. The CExtToolControlBar class does not keep images at all. It manages a collection of CExtBarButton objects. Each button object knows only its command identifier value. The CExtBarButton class uses images stored in the command manager for each registered command. The command manager keeps only one image for each command identifier. This design does not allow you to implement toolbars with a hot-track button effect. To implement a hot-track effect, create a CExtBarButton -derived class in which you need to implement this effect. You could even store several images. This is done in the FunnyBars sample (see the CFunnyToolButton class for details).
|
|
Jonas Gauffin
|
Jul 15, 2005 - 9:28 AM
|
|
|
Technical Support
|
Jul 15, 2005 - 12:11 PM
|
We recommend you use device independent bitmaps (DIB) in toolbar resources. The DIBs are produced by MSPaint and Visual Studio resource editor. Many advanced graphics editors like Adobe Photo Shop can produce bitmaps in non-DIB formats and these bitmaps may be loaded by Prof-UIS incorrectly. Please create a new bitmap in MSPaint editor, paste the existing bitmap into it and, finally, override existing toolbar’s BMP file.
|
|
Jonas Gauffin
|
Jul 15, 2005 - 1:32 PM
|
It works with 16 color images, but not 256.
|
|
Technical Support
|
Jul 16, 2005 - 9:25 AM
|
Could you send your bitmap file to us?
|
|
Krustys Donuts
|
Jul 12, 2005 - 7:22 PM
|
Hi, I’m following the latest example for the property grid control. I now have the in place combobox working to the point that it displays the strings that I’d like displayed. Now I have two questions:
1. How can I make this combobox a droplist (i.e. not editable) instead? I assume it’s a window style, so perhaps I need to subclass CExtGridCellComboBox (and thus also use the IMPLEMENT_ExtGridCell_Clone macro) and then set the window style upon creation. Can you please confirm this?
2. Currently, I have four strings in the in place combobox. For starters, I just want to display a MessageBox anytime a user selects a string. I’ve put the code in Apply(), just like the example. However, this method gets called as soon as I click on the dropdown arrow, which seems a little weird to me since I haven’t actually selected anything yet. Also, as long as I select an item from the droplist, everything is basically ok (except that the messagebox is obscured by the droplist). However, if I type in the edit box and then set the focus elsewhere, my application crashes.
Thanks again, Dave
|
|
Krustys Donuts
|
Jul 18, 2005 - 11:25 AM
|
I have another question regarding the property grid control. I have something that looks like this:
MyStore <-- comboboxbar
+ Field 1 <-- category
Source | Database |v|| <-- property value, combobox
When the user selects something in the source combobox (database or file), I would like a different set of properties to appear below Source, like this:
For database case:
+ Field 1
Source | Database |v||
Query | <enter sql query here> |
For file case:
+ Field 1
Source | File |v||
Filename | <enter filename nere> |
Here are my questions related to this: 1. I assume that I can’t actually add query / filename below source, since there’s an ASSERT( FALSE) in CExtPropertyItem::ItemInsert(), so... 2. I worked around this by creating an "Attributes" category, and then putting query / filename inside of this category, and then inserted the category into Field 1. The problem here is that I can’t get "Attributes" to appear *after* Source, so now my property grid control looks like this:
+ Field 1
+ Attributes
Source | Database |v||
instead of this:
+ Field 1
Source | Database |v||
+ Attributes
I’ve looked at the property grid sample, and it seems to be able to do what I want, but I can’t pinpoint how you actually accomplish this. Any info would be really appreciated! Thanks!
|
|
Technical Support
|
Jul 18, 2005 - 1:45 PM
|
What you need is automatically supported by the property grid control. The CExtPropertyGridComboBoxBar class is part of the CExtPropertyGridCtrl component. The combo box bar keeps a collection of property stores and displays content of the selected property store in the property grid control. This bar in the PropertyGrid sample application contains one property store for each star button on the main dialog window and two combined property stores. The combined property store is a result of the operation called property tree combining. This operation is performed by the CExtPropertyItem::Combine() method and allows you to see properties of several stores in a new combined property store. The similar property value with different CExtGridCell values are displayed as empty/undefined values in the property grid control. Editing an undefined property value changes property values in all the property stores used in the property tree combining operation. The combined property store is a separate CExtPropertyStore instance. To create a combined property store, call its Combine() method.
The CMainDlg::_CombineMixedStoreAll() and CMainDlg::_CombineMixedStoreSelection() methods in the PropertyGrid sample application demonstrates how to combine property stores. The following code snippet in the CMainDlg::OnInitDialog() method shows how to get a pointer to the combo box bar and initialize its content:CExtPropertyGridComboBoxBar * pCombo =
STATIC_DOWNCAST(
CExtPropertyGridComboBoxBar,
m_PGC.GetChildByRTC(
RUNTIME_CLASS(CExtPropertyGridComboBoxBar)
)
);
ASSERT_VALID( pCombo );
pCombo->PropertyStoreInsert( &m_PropertyStoreCompoundSelection );
pCombo->PropertyStoreInsert( &m_PropertyStoreAll );
pCombo->PropertyStoreInsert( m_Btn1.GetPropertyStore() );
pCombo->PropertyStoreInsert( m_Btn2.GetPropertyStore() );
pCombo->PropertyStoreInsert( m_Btn3.GetPropertyStore() );
pCombo->PropertyStoreInsert( m_Btn4.GetPropertyStore() ); Please note that the CExtPropertyGridComboBoxBar class does not delete inserted property store objects.
|
|
Technical Support
|
Jul 13, 2005 - 10:05 AM
|
To make any CExtGridCell object (including CExtGridCellComboBox ) non-editable, just apply the __EGCS_READ_ONLY cell style to make the in-place editor control read-only. You can apply the __EGCS_NO_INPLACE_CONTROL cell style to disable activation of the in-place editor control at all. You can change the style of the grid cell object by using the ModifyStyle() method of the grid cell objects used in property values. To catch the selection change event, create a CExtGridCellComboBox -derived class and override the CExtGridCell::OnPopupListBoxSelEndOK() virtual method which should return the value from parent method and perform your custom actions. You can invoke the wndListBox.GetCurSel() code to get the finally selected item’s index in the pop-up list box.
|
|
Krustys Donuts
|
Jul 18, 2005 - 8:53 AM
|
Hi, I think I need to clarify what I was asking for earlier. I’m not interested in making an inplace combobox readonly, actually. I want to just make sure that the user can only select items that I’ve explicitly added to the list (i.e. dropLIST). The default mode is dropdown, which allows a user to type text into the inplace combobox. Is it possible to get droplist functionality? I couldn’t find any style modifiers for this.
|
|
Technical Support
|
Jul 18, 2005 - 1:22 PM
|
You can apply the __EGCS_NO_INPLACE_CONTROL style to any grid cell object by using its CExtGridCell::ModifyStyle() method. Such a grid cell, which shows pop-up list box by clicking its drop-down button, will behave as drop-down-list combo box control. You should apply the __EGCS_NO_INPLACE_CONTROL style to the cell objects used inside property values.
|
|
Krustys Donuts
|
Jul 18, 2005 - 2:29 PM
|
That seems to work okay, however, I’d like it to be more like standard droplist comboboxes, where clicking on the blank area itself (and not just the dropdown arrow) will cause the list to appear. Can this be added?
|
|
Technical Support
|
Jul 19, 2005 - 8:19 AM
|
In this case, your should create and use your own grid cell class which can be derived from CExtGridCell or any other grid cell class available in Prof-UIS. Here it is the basic implementation of the drop-down-list grid cell class:class C_YOUR_GridCell : public BASE_CELL_CLASS
{
public:
DECLARE_SERIAL( C_YOUR_GridCell );
IMPLEMENT_ExtGridCell_Clone( C_YOUR_GridCell, BASE_CELL_CLASS );
C_YOUR_GridCell(
CExtGridDataProvider * pDataProvider = NULL
)
: BASE_CELL_CLASS( pDataProvider )
{
ModifyStyle( __EGCS_BUTTON_DROPDOWN, 0L );
}
bool OnClick(
CExtGridWnd & wndGrid,
const CExtGridHitTestInfo & htInfo,
UINT nChar, // VK_LBUTTON,
// VK_RBUTTON or VK_MBUTTON only
UINT nRepCnt, // 0 - button up,
// 1 - single click
// 2 - double click
// 3 - post single click(begin edit)
UINT nFlags // mouse event flags
)
{
bool bRetVal =
BASE_CELL_CLASS::OnClick(
wndGrid,
htInfo,
nChar,
nRepCnt,
nFlags
);
if( nRepCnt != 0 )
return bRetVal;
if( (htInfo&__EGBWA_CELL_BUTTON) != 0 )
return bRetVal;
TrackCellStateInfo_t _tcsi(
(*this),
wndGrid,
INT(CExtGridCell::__EBTT_DROPDOWN),
htInfo.m_rcExtra,
htInfo.m_rcItem,
htInfo.m_nVisibleColNo,
htInfo.m_nVisibleRowNo,
htInfo.m_nColNo,
htInfo.m_nRowNo,
htInfo.GetInnerOuterTypeOfColumn(),
htInfo.GetInnerOuterTypeOfRow()
);
OnButtonPopupMenuTrack( _tcsi );
return true;
}
} // class C_YOUR_GridCell
IMPLEMENT_SERIAL(
C_YOUR_GridCell,
BASE_CELL_CLASS,
VERSIONABLE_SCHEMA|1
); If your cell class contains some specific data properties, then you will need to override the CExtGridCell::Serialize() , CExtGridCell::Assign() , CExtGridCell::Compare() , CExtGridCell::TextGet() , CExtGridCell::TextSet() and CExtGridCell::GetVariant() methods. You can use the CExtGridCellBool class as a sample in this case.
|
|
Saroj Acharya
|
Jul 12, 2005 - 12:29 PM
|
Hi Customer Support, My application has two slider controls in the toobar. Both of these controls are placed in the window derived from CExtResizableDialog. My problem is that they are not visible when I first display the window. But when I resize the same window, both of the slider controls will appear in the right place. I tried calling various functions such as pSliderControl->Show(), pSliderControl->RecalcSliderLayout() or m_wndToolBar.Invalidate() & m_wndToolBar.RedrawWindow(), but none of them help. Can you help me with this problem ? The only thing that will show these controls is to resize the window by slightly changing it’s size. When another window (lets sat Windows Explorer) totally covers this wiondow and it reappears, the controls will not reappear. That means WM_PAINT is not helping. Thanks for your help. Saroj
|
|
Technical Support
|
Jul 12, 2005 - 1:06 PM
|
Please make sure that you use the RepositionBars method. It should be called at the end of the OnInitDialog method:BOOL CPageToolbars::OnInitDialog()
{
CPageBase::OnInitDialog();
...
...
...
CWnd::RepositionBars(0,0xFFFF,0);
return TRUE;
} and in the WM_SIZE handler:void CPageToolbars::OnSize(UINT nType, int cx, int cy)
{
CPageBase::OnSize(nType, cx, cy);
if( nType != SIZE_MINIMIZED )
CWnd::RepositionBars(0,0xFFFF,0);
} If you changes content of the toolbar at runtime, you should also callCWnd::RepositionBars(0,0xFFFF,0); If this does not help, try to use the SetWindowPos() method to send WM_SIZE to the toolbar window:m_wndToolBar.SetWindowPos(
NULL, 0, 0, 0, 0,
SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOOWNERZORDER
|SWP_NOCOPYBITS|SWP_NOACTIVATE
|SWP_FRAMECHANGED
);
|
|
Saroj Acharya
|
Jul 12, 2005 - 1:22 PM
|
Thanks for the prompt reply. I double checked my code and looks like I had everything in my code you mentioned in the email except the code to send WM_SIZE message to the window. I try putting that code in, and I still do not see those two Slider controls when the application first starts. But it will appear as soon as I change the size of that window. Any idea why ? I could send you my entire project if you would like to have a look. Regards, Saroj
|
|
Technical Support
|
Jul 12, 2005 - 2:01 PM
|
Please also try to update you toolbar in this way:
CRect rcWindow;
m_wndToolBar.GetWindowRect( &rcWindow );
m_wndToolBar.SetWindowPos(
NULL, 0, 0,
rcWindow.Width(), rcWindow.Height(),
SWP_NOMOVE|SWP_NOZORDER|SWP_NOOWNERZORDER
|SWP_NOCOPYBITS|SWP_NOACTIVATE
|SWP_FRAMECHANGED
);
|
|
Saroj Acharya
|
Jul 13, 2005 - 8:38 AM
|
I even tried this latest code, it does not help. I still do not see those two slider controls in the toolbar. BUt when the window is re-sized, they appear. Saroj
|
|
Technical Support
|
Jul 12, 2005 - 1:26 PM
|
If you send us your project that would help us to quickly find out what’s wrong with this issue.
|
|
Saroj Acharya
|
Jul 13, 2005 - 8:37 AM
|
I sent you my project and hopefully it will help you find the problem.
|
|
Technical Support
|
Jul 13, 2005 - 11:17 AM
|
We tested your project and found no problems. The slider is always visible when the control bar becomes visible. We sent you our recommendations and advice by e-mail.
|
|
Saroj Acharya
|
Jul 18, 2005 - 8:54 AM
|
Thanks for the splendid support. As discussed in the email, the problem is resolved. Thanks again !!!
|
|