Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Any xHarbour/Fivewin users out there?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Any xHarbour/Fivewin users out there?

 Post Reply Post Reply
Author
Message Reverse Sort Order
reinaldo View Drop Down
Newbie
Newbie


Joined: 13 January 2011
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote reinaldo Quote  Post ReplyReply Direct Link To This Post Topic: Any xHarbour/Fivewin users out there?
    Posted: 13 January 2011 at 5:20pm
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.

Back to Top
Jeff B View Drop Down
Newbie
Newbie
Avatar

Joined: 01 June 2009
Location: Canada
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jeff B Quote  Post ReplyReply Direct Link To This Post 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


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.