Codejock.CalendarDialogs.13.x.x

This forum is for support of XCodeJock
Post Reply
Message
Author
User avatar
Auge_Ohr
Posts: 1251
Joined: Wed Feb 24, 2010 3:44 pm

Codejock.CalendarDialogs.13.x.x

#1 Post by Auge_Ohr »

hi,

i knew that Codejock.CalendarDialogs.13.x.x can create a "internal" Edit Dialog,
Codejock.CalendarDialogs
Codejock.CalendarDialogs
CJ_Dialog.JPG (116.19 KiB) Viewed 7561 times
but still i can not get it in Xbase++ :(

did someone found a Solution ?

here some WinDev (http://www.windev.com/) Code how to get Codejock.CalendarDialogs

Code: Select all

// this is WinDev Code

PROCEDURE DTPDblClick()

oDialogs is object Automation dynamic 
// oDialogs = new object automation "Codejock.CalendarDialogs.13.0.0"
oDialogs = new object Automation "{40DD8A69-ECB7-43BF-904C-65DE08A8C302}"

// oActiveView is object Automation dynamic = AX_ActiveX1>>ActiveView
// nNo         is numeric = AX_ActiveX1>>ActiveView>>HitTest>>HitCode
oHitTest    is object Automation dynamic = AX_Calender>>ActiveView>>HitTest
//
// assign Dialogs to Calender
//
oDialogs>>Calendar = AX_Calender 

IF oHitTest>>ViewEvent <> Null THEN
  oDialogs>>ShowEditEvent( oHitTest>>ViewEvent>>Event )
ELSE
  oDialogs>>ShowNewEvent
END
//
// show Result in Calender
//
AX_Calender>>Populate
greetings by OHR
Jimmy

User avatar
Auge_Ohr
Posts: 1251
Joined: Wed Feb 24, 2010 3:44 pm

Re: Codejock.CalendarDialogs.13.x.x

#2 Post by Auge_Ohr »

hi,

i think i found the Differenz

Code: Select all

#define CJ_CAL    "Codejock.CalendarControl.13.x.x"
#define CJ_LIC    "Calendar Control Copyright (c) 2003-2009 Codejock Software" + CHR( 13 ) + CHR( 10 ) + ;
                  "PRODUCT-ID: Codejock.Calendar.ActiveX.vxx.0" + CHR( 13 ) + CHR( 10 ) + ;
                  "VALIDATE-CODE: xxx-xxx-xxx-xxx"

#PRAGMA LIBRARY( "ASCOM10.LIB" )

PROCEDURE APPSYS
RETURN

PROCEDURE MAIN(cNo)
...
DEFAULT cNo TO "2"

   nNo := VAL(cNo)
   DO CASE
      CASE nNo == 1
      //
      // will crash @ oDialog
      //
      oCalCon   := XbpActiveXControl():new( oDlg:drawingArea,, {0,0},{aSize[1]-10,aSize[2]-30} )
      oCalCon:CLSID   := CJ_CAL
      oCalCon:License := CJ_LIC
      oCalCon:create()

      CASE nNo == 2
      //
      // use CreateObject and :DynamicCast( ActiveXObject() )
      //
      oCalCon   := CreateObject(CJ_CAL,,CJ_LIC)
      oCalCon   := oCalCon:DynamicCast( ActiveXObject() )
   ENDCASE

   ErrorBlock( {|e| Break(e)} )
   BEGIN SEQUENCE
      ohWnd := oCalCon:getProperty("hWnd")
   RECOVER USING oError
      MsgBox("Error hWnd()")
      ErrorBlock( bSaveError )
   END SEQUENCE
   ErrorBlock( bSaveError )

   ErrorBlock( {|e| Break(e)} )
   BEGIN SEQUENCE
      //
      // internal Dialogs
      //
      oDialogs  := CreateObject("Codejock.CalendarDialogs.13.x.x")
      //
      // works : AutomationObject:setProperty("Prop", AutomationObject )
      //
      // crash : AutomationObject:setProperty("Prop", XbpActiveXControl() )
      //
      oDialogs:Calendar := oCalCon

      //
      // show internal Dialog
      //
      oDialogs:ShowNewEvent()     // might in Backgound ... use ALT-TAB

     RECOVER USING oError
         MsgBox("Error oDialogs()")
         ErrorBlock( bSaveError )
     END SEQUENCE
     ErrorBlock( bSaveError )

   ENDIF

   IF IsMemberVar(oCalCon, "Options")
      oOptions  := oCalCon:Options()
      oOptions:FirstDayOfTheWeek := xtpCalendarDayMonday  // "XBCJCAL.CH"
   ELSE
      //
      // only XbpActiveXControl() can ":SubClass" Property "Options"
      //
      // CreateObject() and AutomationObject() does not get Property
      //
      MsgBox("No Property Options()")
   ENDIF

   oDlg:show()
this Way (nNo = 2) you can show "internal" Dialog, but than no Property or Methode are found :think:
i did other activeX with CreateObject(CJ_CAL,,CJ_LIC) / o:DynamicCast( ActiveXObject() ) which work fine ...

if both, Calendar and Dialogs, are AutomationObject() you can use :SetProperty().
you can not use a XbpActiveXControl() as Property for a AutomationObject()

Code: Select all

Super Class
         AutomationObject() by CreateObject()
         // using
         oObj := oObj:dynamicCast( ActiveXObject() )
         ->
         Sub Class
               ActiveXObject()
               // using
               oObj := oObj:???  // what ... ???
               ->
               Sub Class
                      XbpActiveXControl()
how do i get from ActiveXObject() to XbpActiveXControl() ???
what is the Differenz between ActiveXObject() and XbpActiveXControl() ?
greetings by OHR
Jimmy

Post Reply