FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Codejock Calendar with Harbour ( vs xHarbour )
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Codejock Calendar with Harbour ( vs xHarbour )
Posted: Thu Jun 07, 2012 03: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 (fw): Select all Collapse
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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codejock Calendar with Harbour ( vs xHarbour )
Posted: Sat Jun 30, 2012 02: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
Posts: 222
Joined: Mon Jun 04, 2012 12:00 PM
Re: Codejock Calendar with Harbour ( vs xHarbour )
Posted: Sat Jun 30, 2012 05:15 PM

Antonio,
Please Why not ultimate the Calex Class of Daniel ?

Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Codejock Calendar with Harbour ( vs xHarbour )
Posted: 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
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: Codejock Calendar with Harbour ( vs xHarbour )
Posted: Fri Mar 08, 2013 07: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

Continue the discussion