Welcome! Log In Create A New Profile

Advanced

ActiveX - calendar

Posted by Arie 
Arie
ActiveX - calendar
December 22, 2008 08:19AM
Hi,
I'm testing an ActiveX control (Xtreme calendar from www.CodeJock.com).
When I use this activex in VB or Delphi I get on top level object (CCalendarObject) and several other objects, underneath. All these object are needed to populate the calendar and can in fact hold other object itself.
In Windev I only see the top level object. Is there any way to get these inside objects as well?

2. Are there any calendar controls out there for use in WD? I'm looking for a outlook style calendar. I've seen a very simple WD-example (wdschedule), but that's far from complete as those activex components.

Arie
David Egan
Re: ActiveX - calendar
December 22, 2008 08:42AM
Hi Arie
If you can get it to work in Windev I'd sure be interested. I laboured with it but didn't have much success once I needed to get serious, because I couldn't work out how to get access to those other objects. I got further with GravityBox GBSchedule but the project I needed it on was put in abeyance so I haven't fully explored it. Not quite as pretty as Codejock but for what I needed to do at the time (relatively simple scheduling for some hairdressing salons with up to 6 chairs) it seemed to be OK.

HTH

David
Alexandre Leclerc
Re: ActiveX - calendar
December 22, 2008 02:37PM
Hi Arie and David,

I'll share some code example for you. This was a bit of search, but in the end it's quite simple. (Well, the biggest problem was to think the WinDev way and not the usual activex way. I'm still not always getting it... :-))

In the following examples AX_ActiveX1 is an Xtreme Calendar Control.

Code in the initialization of AX_Activex1:
// set default appearance
AX_ActiveX1>>ViewType = 1

// "add" example
pautTest is object Automation dynamic = AX_ActiveX1>>DataProvider>>CreateEvent
pautTest>>StartTime = "2008/12/22 13:00:00"
pautTest>>EndTime = "2008/12/22 15:00:00"
pautTest>>Body = "Read messages on [forum.mysnip.de];
pautTest>>Label = 1
pautTest>>Subject = "Read forum messages"
AX_ActiveX1>>DataProvider>>AddEvent(pautTest)

// Update display
AX_ActiveX1>>Populate

This code will change the calendar view: Drop a Button and put the following code in the button "OnClick" event.
i is int = AX_ActiveX1>>ViewType
i++
IF i>3 THEN i=0
AX_ActiveX1>>ViewType = i
MySelf..Caption = i

DatePicker example with events.

Add a second control AX_ActiveX2 as an XTreme DatePicker Control.
This example will trap a calendar event.

Initialization code:
ActiveXEvent("DTPSelectionChanged",AX_ActiveX2,"SelectionChanged")

DTPSelectionChanged code:
PROCEDURE DTPSelectionChanged()

nBlocksCount is int = AX_ActiveX2>>Selection>>BlocksCount
FOR i = 1 TO nBlocksCount
	dDbg is Date = AX_ActiveX2>>Selection>>Blocks(i-1)>>DateBegin
	dEnd is Date = AX_ActiveX2>>Selection>>Blocks(i-1)>>DateEnd
	Info("Selection begins on "+dDbg+" and ends on  "+dEnd)
END

I hope that these simple examples will help you working with CodeJock calendar control.

Best regards.
Arie
Re: ActiveX - calendar
December 22, 2008 10:56PM
Thanks Alexandre!!

The line
pautTest is object Automation dynamic = AX_ActiveX1>>DataProvider>>CreateEvent
indeed did the trick!

There's another one I could solve now. According to the Codejock help there is an event:
Public Event EventAddedEx( _ ByVal pEvent As CalendarEvent _)
Again: an object, unknown to Windev, as parameter. This one, you cannot "port" like you did above.

But in the typelibrary, generated by Delphi, I found this event. This one isn't in my Codejock helpfile!! But server the same purpose:
Public Event EventAdded( _ ByVal pEventID As Integer _)

Then you can use (as I learned from you)
pautTest is object Automation dynamic = AX_ActiveX1>>DataProvider>>GetEvent(nEventID)
Info(pautTest>>StartTime,pautTest>>EndTime,pautTest>>Body,pautTest>>Subject,etc,etc,)

Thanks again for puuting me (and others) in the right direction. Now I can sit under the X-mas tree and relax.

Arie
Alexandre Leclerc
Re: ActiveX - calendar
December 23, 2008 03:06PM
Hi Arie,

In fact I tested it and you can access it directly... (I would like that all this be more documented.) Since the event returns a pointer to a valid object, you can access the information. It will be resolve at run-time.

Lets take the same AX_Activex1 example.

In the initialisation part (put the following as the first instruction in the previous example):
ActiveXEvent("EventAddedEx",AX_ActiveX1,"EventAddedEx")

And the procedure EventAddedEx()
PROCEDURE EventAddedEx(pEvent)

Trace(pEvent>>StartTime,pEvent>>EndTime,pEvent>>Body,pEvent>>Subject)

You will get in the trace:
39804.54166667 39804.625 Read messages on [forum.mysnip.de] Read forum messages

I hope this will help (especially for code "simpleness" - less instructions to get the same information).

Best regards.
Arie
Re: ActiveX - calendar
December 23, 2008 08:32PM
Alexandre,
I tried this, in a very early stage, and it didn't work then. After that I took is as a fact.
I think I did more things wrong then.

You're right. It's is much more simple. So I will try it again. I'm sure it will work, beacuse you say so...

Thanks.
Arie
Arie
Re: ActiveX - calendar
December 24, 2008 02:43PM
Alexandre, another question.

there's also a CalendarGlobalSettings-Object. I need this for changing the language to dutch, through the ResourceFile property.
However, I cannot find any pointer to this object via the overall CalendarObject, by one of the poperties of methods.

Any hints?

Arie
Alexandre Leclerc
Re: ActiveX - calendar
December 24, 2008 03:38PM
Hi Arie,

You must go "the hard way" for that one. (I personally know no other way to do it - if someone else knows... please contribute! :-))

I searched under which server UID the class CalendarGlobalSettings is registered in the registry and it is {AC710EA7-1548-4C7B-8D03-8368119C057C}. It should be the same for you.

Always in the initialization (of the window, as documented):

pautCalendarGlobalSettings is object Automation "{AC710EA7-1548-4C7B-8D03-8368119C057C}"
Trace("Version",pautCalendarGlobalSettings>>Version)
Trace("OcxPath",pautCalendarGlobalSettings>>OcxPath)

This will create the object and you will be able to work with it.

Best regards.



Edited 1 time(s). Last edit at 12/24/2008 03:44PM by Alexandre Leclerc.
Arie
Re: ActiveX - calendar
December 24, 2008 04:01PM
Thanks again! I know about UID's an so on.
But I did not know I could do it this way in Windev!

By the way, my UID for this object is {F101EB47-BD61-4467-A57A-8D361640BB27}. Should be the same indeed as yours. I think I have a newer version of the control (just bought the latest).


Arie
Alexandre Leclerc
Re: ActiveX - calendar
December 24, 2008 04:08PM
Hi Arie,

My CalendarGlobalSettings says 11.2.2! smiling smiley This is not the latest version indeed.

Best regards.
Fred
Re: ActiveX - calendar
February 14, 2009 01:47PM
Hi,
do you have any example to send me because i don't know how to use this activex.
Thanks you
fredericloire@free.fr
Arie
Re: ActiveX - calendar
February 15, 2009 11:37PM
I will make a small example. Just give me a few days.
(btw I'm using WD12)

Arie
Arie
Re: ActiveX - calendar
February 17, 2009 11:11AM
I posted a small sample in the "solutions" part.
[forum.mysnip.de]

Arie
Mark Irwin
Re: ActiveX - calendar
March 29, 2009 04:15AM
Hi All,

I have got most things working in the calendar but recurring events are still a problem.

Has anybody managed to get them to work?

Regards
Mark
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: