Any xHarbour/Fivewin users out there? |
Post Reply |
Author | |
Jeff B
Newbie Joined: 01 June 2009 Location: Canada Status: Offline Points: 5 |
Post Options
Thanks(0)
Posted: 01 June 2009 at 11:51am |
Hi,
I am new to ActiveX and Codejock (still playing with trial version) I was wondering if there is anyone out there that has used the Calendar Control with xHarbour/Fivewin? So far I have only been able to display the Calendar via: oAct := TActiveX():New( oWnd, "Codejock.CalendarControl.13.0.0", 10, 0, 1000, 550 ) I have also figured out how to set the Work data start and end times, open/save an xml data provider and switch views ... so basic stuff. How would I extract an event and use the data from it in my app? How can I tie an event to a record in a table? Any help would be appreciated :-) Thanks in advance, Jeff. Win XP Fivewin 9.04 xHarbour 1.2.1 CodeJock demo v13.0.0 |
|
reinaldo
Newbie Joined: 13 January 2011 Status: Offline Points: 8 |
Post Options
Thanks(0)
|
Jeff; Here is how to sync dbf data to CodeJock CalendarControl: TRY ::oCalex := tActiveX():New( ::oPanelCalex, "Codejock.CalendarControl.13.4.2" ) CATCH WriteErrorLog( oErr ) MsgStop( "Missing installation Components", "Aborting" ) Quit END with object ::oCalex :VisualTheme( xtpCalendarThemeOffice2007 ) :bOnEvent = { | event, aParms | ::xTrmCalTriggeredEvents( Event, aParms ) } :SetDataProvider( "Provider=custom" ) if !:DataProvider:open() ;:DataProvider:Create() ;endif .... //-----------------------------------------------------------------------------------------------------// METHOD xTrmCalTriggeredEvents( Event, aParms ) CLASS MpCal if valType( Event ) == "C" Do Case Case Event == "DoRetrieveDayEvents" ::RetrieveDayEvents( aParms ) // Case Event == "DblClick" // Case Event == "MouseMove" // Case Event == "MouseDown" // case Event == "KeyDown" // case Event == "IsEditOperationDisabled" // case Event == "IsEditOperationDisabledV" // case Event == "DoUpdateEvent" // case Event == "BeforeEditOperation" case Event == "EventAddedEx" ::InsertEvent( aParms[ 1 ] ) case Event == "EventChangedEx" .and. aParms[ 1 ]:CustomProperties:Property( "Guid" ) != Nil ::UpdateEvent( aParms[ 1 ] ) case Event == "EventDeletedEx" .and. aParms[ 1 ]:CustomProperties:Property( "Guid" ) != Nil ::DeleteEvent( aParms[ 1 ] ) otherwise Logfile( "trace.log", { EventInfo( event, aParms ) } ) End endif Return nil //-----------------------------------------------------------------------------------------------------// METHOD InsertEvent( oEvent ) CLASS MpCal /*local cSql := "Insert Into appntmnts (Subject, StartTime, EndTime, More_Info ) "+; "Values( '" + oEvent:Subject() + "', " +; "Convert( '" + TtoC( oEvent:StartTime() ) + "', SQL_TIMESTAMP ), " +; "Convert( '" + TtoC( oEvent:EndTime() ) + "', SQL_TIMESTAMP ), " +; "'"+oEvent:Body() + "') " */ ::odbf:VarSubject := oEvent:Subject() ::odbf:VarStartTime := oEvent:StartTime() ::odbf:VarEndTime := oEvent:EndTime() ::odbf:VarMore_Info := oEvent:Body() ::odbf:Append() ::odbf:Save() oEvent:CustomProperties:Property( "guid", ::odbf:Guid ) //every time a new appointment is added on the calendar control //expand appntmnt details with a custom form for tel, med rec, email ::EventDetails( oEvent ) Return oEvent //-----------------------------------------------------------------------------------------------------// METHOD UpdateEvent( oEvent ) CLASS MpCal local cSql := "Update appntmnts set Subject = '" + oEvent:Subject() + "', " +; "StartTime = Convert( '" + TtoC( oEvent:StartTime() ) + "', SQL_TIMESTAMP ), " +; "EndTime = Convert( '" + TtoC( oEvent:EndTime() ) + "', SQL_TIMESTAMP ), " +; "More_Info = '" + oEvent:Body() + "' " + ; "Where guid = '" + oEvent:CustomProperties:Property( "Guid" ) + "'" ExecuteSqlScript( cSql, .f. ) ::EventDetails( oEvent ) return oEvent //-----------------------------------------------------------------------------------------------------// METHOD DeleteEvent( oEvent ) CLASS MpCal local cSql := "Delete from appntmnts " + ; "Where guid = '" + oEvent:CustomProperties:Property( "Guid" ) + "'" ExecuteSqlScript( cSql, .f. ) return oEvent Reinaldo. |
|
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 |