Codejock Calendar Samples?

Codejock Calendar Samples?

Postby Jeff Barnes » Fri May 29, 2009 1:20 am

Hi,

I am playing with the Codejock calendar demo and wonder if anyone can guide me as to how to use the commands.

I am able to get a calendar on the screen from reading other posts but that's about all I can get working. (First time working with ActiveX)

I just don't know how to issue the commands to do anything.

Are there any samples files that show how to use Codejock with FWH ?

Code: Select all  Expand view  RUN

#include "FiveWin.ch"
function Main()  
   local oWnd, oAct

   DEFINE WINDOW oWnd
     oAct := TActiveX():New( oWnd, "Codejock.CalendarControl.13.0.0", 10, 0, 1000, 550 )  
   ACTIVATE WINDOW oWnd

return nil

 
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Codejock Calendar Samples?

Postby Jeff Barnes » Wed Jun 03, 2009 1:43 am

Looks like no one else has played with the Calendar control from Codejock????

Here is what I have been able to get working so far...


Code: Select all  Expand view  RUN

//start the calendar object
oAct := TActiveX():New( oWnd, "Codejock.CalendarControl.13.0.0", 100, 0, 1000, 550 )  


//Use XML as the data provider
oAct:SetDataProvider:="Provider=XML;Data Source=\YourPath\Events.xml"

//Create a blank data provider using info from above
//(no need to OPEN it after a create)
oAct:DataProvider:Create()

//If data provider is already created you can just open it
oAct:DataProvider:Open()

//Set the time scale in day view
oAct:DayView:Timescale := 30

//show a specific date when starting
oAct:ActiveView:ShowDay:= Date()

//Set the view (in this case the "day" view
oAct:ViewType:=xtpCalendarDayView

//Set the normal working hours (show up in different color)
oAct:Options:WorkDayStartTime("8:00:00 AM")
oAct:Options:WorkDayEndTime("8:00:00 PM")

//Scroll the time to "WorkDayStartTime"
oAct:DayView:ScrollToWorkDayBegin()

//Set the week view to "work week" (5 days) instead of a 7 day week
oAct:ViewType:= xtpCalendarWorkWeekView

//Set the theme
oAct:VisualTheme:=xtpCalendarThemeOffice2007

//Show/Hide the time line button
oAct:ShowTimelineButton:=  .f.

//Set/Hide Caption Bar
oAct:ShowCaptionBar:= .t.

//Show/Hide the date scroll buttons
oAct:ShowCaptionBarScrollDateButtons:= .t.

 



I am still trying to figure out how to add and retrieve and event via programming.
Also need to figure out how to set cell colors.


If anyone has info to add, please do.
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Codejock Calendar Samples?

Postby Jeff Barnes » Wed Jun 03, 2009 1:58 am

Here are some sample screen shots of the calendar from the code in the previous post.

Image

Image

Image

Image
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Codejock Calendar Samples?

Postby dutch » Wed Jun 03, 2009 3:53 am

Dear Jeff,

It's very good sample. Can we use DBF file instead of XML file?

Regards,
Dutch
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1543
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Codejock Calendar Samples?

Postby Jeff Barnes » Wed Jun 03, 2009 1:03 pm

You can connect to other data sources like Access, MySql, etc...
I am trying to connect (via ODBC) to the database I have created in MySQL but no luck so far.
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Codejock Calendar Samples?

Postby dutch » Wed Jun 03, 2009 8:15 pm

Dear Jeff,

I can connect via TMySql without ODBC. Just add 2 LIB files, that's all.

viewtopic.php?f=3&t=15625

Regards,
Dutch
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1543
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Codejock Calendar Samples?

Postby TimStone » Wed Jun 03, 2009 10:37 pm

I have not worked with this recently. However, when I discussed it with the people at Codejock ( they are really nice and offer to be helpful ), we can write our own code to work with .dbf files, or we can use the memory model and then save the elements to the file. That does involve essentially loading / unloading data from the disk and that could slow down the process.

I've been thinking about playing with it again ... the interface would be nice.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2945
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Codejock Calendar Samples?

Postby Jeff Barnes » Sun Jun 07, 2009 12:16 am

Hi Dutch,

It's not my app that I am trying to get connected to MySQL (I achieved this via Mediator ... I wanted to be able to use the MySQL tables like DBF files) but the actual calendar control.
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Codejock Calendar Samples?

Postby norberto » Sun Jun 07, 2009 4:19 pm

hi, i need this with dbf or adt files, someone try with sucess?? thanks
norberto
 
Posts: 566
Joined: Thu Aug 30, 2007 3:40 pm
Location: BR

Re: Codejock Calendar Samples?

Postby reinaldocrespo » Thu Jan 13, 2011 3:59 pm

Hi everyone;

Just came across this post, and thought I should share some answers. Yes, CodeJock calendar control does work with dbfs/ adts/ xml/ mdb/ SQL/ arrays/ Objects, or just about any other type of data.

Here is a short sample on working with a tdata class based on dbfs. I'm trying to keep the code simple. The intent is show how to connect dbf data to CodeJock ExtremeCalendar Control:
Code: Select all  Expand view  RUN

//create the object
::oCalex := tActiveX():New( ::oPanelCalex, "Codejock.CalendarControl.13.4.2" )

//set some properties
with object ::oCalex
   
    :VisualTheme( xtpCalendarThemeOffice2007 )
    :bOnEvent = { | event, aParms | ::xTrmCalTriggeredEvents( Event, aParms ) }
       
    :SetDataProvider( "provider=custom" )
    if !:DataProvider:open()    ;:DataProvider:Create() ;endif
       
    :ShowCaptionBar( .t. )
    :ViewType( xtpCalendarDayView )

    :DayView:ShowLinks( .t. )
    :DayView:TimeScaleMinTime( [8:00:00 AM] )
    :DayView:TimeScaleMaxTime( [6:00:00 PM] )
    :DayView:TimeScale( 10 )
    :DayView:ScrollToWorkDayBegin()     //scroll the view to the work day starting time

    :Options:DayViewTimeScaleShowMinutes( .t. )

end

 


//now all you have to do is create the triggered events to write/read from dbfs

Code: Select all  Expand view  RUN

//-----------------------------------------------------------------------------------------------------//
METHOD xTrmCalTriggeredEvents( Event, aParms ) CLASS MpCal

    if valType( Event ) == "C"

        Do Case

        Case Event == "DoRetrieveDayEvents"        
            ::RetrieveDayEvents( aParms )

        case Event == "EventAddedEx"
            ::InsertEvent( aParms[ 1 ] )

        case Event == "EventChangedEx"
            ::UpdateEvent( aParms[ 1 ] )

        case Event == "EventDeletedEx"
            ::DeleteAppnt( aParms[ 1 ] )
           
        End

    endif
   
Return nil

//-----------------------------------------------------------------------------------------------------//
METHOD InsertEvent( oEvent ) CLASS MpCal
    ::odbf:VarSubject   := oEvent:Subject()
    ::odbf:VarStartTime := oEvent:StartTime()
    ::odbf:VarEndTime   := oEvent:EndTime()
    ::odbf:VarMore_Info := oEvent:Body()
   
    ::odbf:Append()
    ::odbf:Save()

    //fill in a custom property on this entry to link to unique key on dbf.  Field Guid is auto-field using
    //an On-Insert trigger on the dbf and it defaults to a global unique string used as primary key.
    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

//-----------------------------------------------------------------------------------------------------//
//using SQL is less writing, but the same can be done with ISAM.
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 DeleteAppnt( oEvent ) CLASS MpCal
local cSql := "Delete from appntmnts " + ;
        "Where guid = '" + oEvent:CustomProperties:Property( "Guid" ) + "'"
                   
               
    ExecuteSqlScript( cSql, .f. )

return oEvent

//-----------------------------------------------------------------------------------------------------//
//CodeJock ExtremeCalender control calls this function sending a DT parameter and
//the container property that contains all the day entries.  The function should fill in
//the container property with all day events (appointments)

METHOD RetrieveDayEvents( aParms ) CLASS MpCal
Local cSql := "Select mrec, Subject, Last_Name, First_Name, StartTime, EndTime, eMail, Tel, GuId, More_Info " + ;
                "from appntmnts where convert( StartTime, SQL_DATE )= '" + Date2SqlString( aParms[ 1 ] ) + "'"
local arec
local aRet := ExecuteSQLScript( cSql, .f. )
local oEvents := aParms[ 2 ]
local oEvent
   
    for each arec in aret

        oEvent := ::oCalex:DataProvider:CreateEvent()

        With Object oEvent
            :Subject( aRec[ 2 ] ) //TokenUpper( trim( aRec[ 3 ] ) + " " + trim( arec[ 4 ] ) ) )
            :StartTime( aRec[ 5 ] )
            :EndTime( aRec[ 6 ] )
            :body( arec[ 10 ] )
           
            :CustomProperties:Property( "MRec", alltrim( aRec[ 1 ] ) )
            :CustomProperties:Property( "Guid", aRec[ 9 ] )
            :CustomProperties:Property( "Tel", aRec[ 8 ] )
            :CustomProperties:Property( "eMail", aRec[ 7 ] )
           
        End
       
        oEvents:add( oEvent )

    next
   
Retur Nil


 



It works really nice. If anyone needs help, I'll be glad to offer my help. Here is a screenshot:
Image

Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: Codejock Calendar Samples?

Postby reinaldocrespo » Thu Jan 13, 2011 4:13 pm

And here is another screenshot:
Image

Image

Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: Codejock Calendar Samples?

Postby mgsoft » Thu Jan 13, 2011 4:19 pm

Thanks for sharing!!.

Also, Daniel is preparing a Calendar for FW!!
Saludos,

Eduardo
User avatar
mgsoft
 
Posts: 422
Joined: Mon Aug 17, 2009 12:18 pm
Location: España

Re: Codejock Calendar Samples?

Postby Richard Chidiak » Thu Jan 13, 2011 4:23 pm

Reinaldo

This is excellent news

What about the licensing of this control ? How can it be included with an existing application

Thanks for your help,

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: Codejock Calendar Samples?

Postby richard-service » Thu Jan 13, 2011 4:26 pm

Nice job.
I think Codejock have more UI than FWH.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 804
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: Codejock Calendar Samples?

Postby reinaldocrespo » Thu Jan 13, 2011 4:34 pm

About licensing:

http://www.codejock.com/purchase/

ExtremeCalendar ActiveX control is $149.00. There is a 30 day free trial offer. Good for testing and development.


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: betoncu and 44 guests