Codejock Calendar with Harbour ( vs xHarbour )

Codejock Calendar with Harbour ( vs xHarbour )

Postby TimStone » Thu Jun 07, 2012 3:42 pm

I've had Codejock's calendar integrated to my main application using xHarbour/xCC/FWH for over a year and it works very well.

Here is the code that works perfectly in xHarbour to build the calendar:

Code: Select all  Expand view

METHOD BuildCalex() CLASS MpCal
local oErr

    TRY    
        ::oCalex := tActiveX():New( ::oPanelCalex, "Codejock.CalendarControl.15.0.1" )
    CATCH oErr
        MsgStop( "Missing installation Components", "Aborting" )
        Quit
    END
   
    with object ::oCalex
   
        :VisualTheme = ( xtpCalendarThemeOffice2007 )
        :bOnEvent = { | event, aParms | ::xTrmCalTriggeredEvents( Event, aParms ) }
        :SetDataProvider( "Provider=custom" )
        :DataProvider:open()
        :ShowCaptionBar = ( .f. )  
        :ShowCaptionBarSwitchViewButtons = ( .f. )  //turn off switch from day, week, month view on capbar
        :ViewType = ( xtpCalendarDayView )
        :EnableToolTips(.t.)
        :DayView:TimeScaleMinTime = ( [7:00:00 AM] )
        :DayView:TimeScaleMaxTime = ( [7:00:00 PM] )
        :DayView:TimeScale = ( 15 )  
                                :Options:WorkDayStartTime = ( [7:00:00 AM] )
        :DayView:ScrollToWorkDayBegin()     //scroll the view to the work day starting time
        :Options:DayViewTimeScaleShowMinutes = ( .t. )
                                :EnableReminders( .t. )
                                :RemindersUpdatePeriod = ( [12:10:00 AM] )  // Sample has #12:10:00 AM#   Call is as Date
  end

   ::oPanelCalex:oClient = ::oCalex

Return Nil



//---------------------------------------------------//
METHOD BuildDatePicker() CLASS MpCal
local nTmp
local oPanel, oErr, oWnd

    TRY
        ::oDtPick := tActiveX():New( ::oPanelExplorer,"Codejock.DatePicker.15.0.1" )
       
        With Object ::oDtPick
            :Enabled = ( .t. )
            :ShowWeekNumbers = ( .t. )
            :VisualTheme = ( xtpCalendarThemeOffice2007 )
            :AttachToCalendar( TOleAuto():New( ActXPDisp( ::oCalex:hActiveX ) ) )
        End
        ::oPanelExplorer:oClient := ::oDtPick
    CATCH oErr
   
    END
   
RETURN nil



//---------------------------------------------------//
METHOD BuildStdDialogs() CLASS MpCal
local oErr

    TRY

        ::oCalexStdDlgs := CreateObject( "Codejock.CalendarDialogs.15.0.1" )
        ::oCalexStdDlgs:Calendar( TOleAuto():New( ActXPDisp( ::oCalex:hActiveX ) ) )
        ::oCalexStdDlgs:RemindersWindowShowInTaskBar = .t.
        ::oCalexStdDlgs:CreateRemindersWindow()
      CATCH oErr
    MsgInfo( "Missing standard dialogs components" )
    END

RETURN



//---------------------------------------------------//
METHOD BuildPanels() CLASS MpCal
local oBrush
local nHeight := ::oCwnd:nHeight

   ::oPanelCalex    = TPanel():New( 0, 175, ( nHeight ), ::oCwnd:nWidth, ::oCwnd:oWndClient )
   ::oPanelExplorer = TPanel():New( 0, 0, ( nHeight ) , ::oPanelCalex:nLeft, ::oCwnd:oWndClient )
   
RETURN nil


 


In my transition to using Harbour with MSVC 2010, trying to activate the control ended up in a GPF ( no error message ). You will note that in the BuildDatePicker( ) method, and BuildStdDialogs( ) method, there is a use of ActXPDisp( ). Antonio suggested that the return was not correct, and he built an alternative ActXPDispPtr( ). Using that with the BuildDatePicker( ) method allowed the calendar to display, however when using substituting it in BuildStdDialogs( ), it has an error. The screen will display, but the selection of dates and views will not work.

Normally, just like Outlook, the left column shows several months of date picker controls. The right panel shows the schedule for the day. The right column works, and allows for the entry of appointments. However, the left column does not, and thus you can't change dates, or display type ( day, week, month ).

Does anyone have a suggerstion ? This is literally the last obstacle I have in moving from xHarbour ( 2010 ) to current Harbour.

Thanks.

TIm
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: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Codejock Calendar with Harbour ( vs xHarbour )

Postby Antonio Linares » Sat Jun 30, 2012 2:45 pm

Tim,

It seems that you replace this line

::oCalexStdDlgs:Calendar( TOleAuto():New( ActXPDispPtr( ::oCalex:hActiveX ) ) )

with

::oCalexStdDlgs:Calendar = TOleAuto():New( ::oCalex:oOleAuto:__hObj )

then it is working fine :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42090
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Codejock Calendar with Harbour ( vs xHarbour )

Postby Eoeo » Sat Jun 30, 2012 5:15 pm

Antonio,
Please Why not ultimate the Calex Class of Daniel ?
User avatar
Eoeo
 
Posts: 222
Joined: Mon Jun 04, 2012 12:00 pm

Re: Codejock Calendar with Harbour ( vs xHarbour )

Postby TimStone » Mon Jul 02, 2012 10:41 pm

I would like to note that the CodeJock Calendar implementation is now working well with FWH 12.5, Harbour 3.0, and MSVC 2010. All issues have been resolved for this implementation.

Antonio has full code now to include in future builds of FWH\Samples

I believe this is an excellent product that you can include with your applications to give you powerful Calendaring ( just like Outlook ) and appointment scheduling. I agree that having these types of capabilities in FWH is nice, but there are so many things to be on top of right now that having an alternative is a good option.

Tim
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: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Codejock Calendar with Harbour ( vs xHarbour )

Postby Richard Chidiak » Fri Mar 08, 2013 7:19 pm

Hello Tim

I am trying to move my application to Harbour

Can you send me the function ActXPDispPtr( ) modified by Antonio ?

Does Codejock work ok now with Harbour ?

Tia

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 68 guests