ReadOnly |
Post Reply |
Author | |
zaksoft
Senior Member Joined: 05 June 2003 Location: Italy Status: Offline Points: 162 |
Post Options
Thanks(0)
Posted: 29 March 2009 at 4:32am |
How can I set ReadOnly mode ?
In some cases (like preview of appointments for customers taken automaticalli from database and build from custom recordset) I do not want the user to edit or add, just see and (eventually) print.
I've used bEnableInPlaceCreateEvent to prevent adding apps, but I don't know how to prevent moving, change or delete them.
TIA
|
|
VS2022 - MFC MBCS Statically linked
XTP 23.1 Static Link --------------------------------------------------------- Davide Zaccanti - ZakSoft - www.zaksoft.com |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Edit event in the case of disable in-place editing possible only using Event Editor - call by Context Menu which app can control with own logic or mouse click - you can also disable with Advanced Options
|
|
zaksoft
Senior Member Joined: 05 June 2003 Location: Italy Status: Offline Points: 162 |
Post Options
Thanks(0)
|
Sorry, I dont understand your answer.
I've already disabled all edit option available, but doubleclick still open the event detail, I can move, resize and drag&drop to another date..
It is possible to add a SetReadOnly() in future version (I've tested EnableWindow(FALSE) but many functions are not working ) ? TIA. |
|
VS2022 - MFC MBCS Statically linked
XTP 23.1 Static Link --------------------------------------------------------- Davide Zaccanti - ZakSoft - www.zaksoft.com |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Double click call Application event editor form (not part of control itself) - you can disable this call as other context-menu related call for your own read-only mode. I think that we can add ReadOnly flag in future version - may be even on event level |
|
zaksoft
Senior Member Joined: 05 June 2003 Location: Italy Status: Offline Points: 162 |
Post Options
Thanks(0)
|
Double click open
CXTPCalendarOccurSeriesChooseDlg or CXTPCalendarEventPropertiesDlg Can you please tell me how I can override this ?TIA
|
|
VS2022 - MFC MBCS Statically linked
XTP 23.1 Static Link --------------------------------------------------------- Davide Zaccanti - ZakSoft - www.zaksoft.com |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
example - CalendarDemo MFC app - handler for context menu create and call internal dialog - but you can use your own dialog here
case ID_POPUP_PROPERTIES:
{ ASSERT(hitInfo.pViewEvent); if (hitInfo.pViewEvent){ CXTPCalendarEvent* pEvent = hitInfo.pViewEvent->GetEvent(); CXTPCalendarEventPtr ptrEvent = pEvent->CloneEvent(); CXTPCalendarControl::CUpdateContext updateContext(&GetCalendarCtrl(), xtpCalendarUpdateLayout|xtpCalendarUpdateRedraw); CXTPCalendarEventPropertiesDlg dlg(&GetCalendarCtrl(), FALSE, this, ptrEvent);dlg.m_bOccurrence = TRUE; dlg.DoModal(); } }
BTW- I add public member of CXTPCalendarControl - BOOL m_bReadOnlyMode; and property in ActiveX ReadOnlyMode user can get and set on app level |
|
zaksoft
Senior Member Joined: 05 June 2003 Location: Italy Status: Offline Points: 162 |
Post Options
Thanks(0)
|
Thank you, meanwhile I've inserted: ASSERT(ptrCalendarConn); in calendar (into dialog-derived class) init function and void CPlannerPreview::OnEvent_Calendar(XTP_NOTIFY_CODE Event, WPARAM wParam, LPARAM lParam) void CPlannerPreview::OnEvent_IsEditActionDisabled(XTP_NOTIFY_CODE Event, WPARAM wParam, LPARAM lParam) // check is already canceled/handled So no action can be taken. |
|
VS2022 - MFC MBCS Statically linked
XTP 23.1 Static Link --------------------------------------------------------- Davide Zaccanti - ZakSoft - www.zaksoft.com |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Right - I told you that you have enough already exited features to prevent non-needed actions
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |