Home » Developer & Programmer » Forms » OCX Calendar Control 9.0  () 1 Vote
icon5.gif  OCX Calendar Control 9.0 [message #127752] Wed, 13 July 2005 02:36 Go to next message
sQeKy
Messages: 24
Registered: July 2005
Junior Member
All the calendar making procedures i have seen here use these library files...stndrd20.olb and calendar.pll
what if u want the active x .. calendar control 9.0 ... to make a calendar .. just in the same fashion ....
how to do that ?
Re: OCX Calendar Control 9.0 [message #127908 is a reply to message #127752] Thu, 14 July 2005 02:03 Go to previous messageGo to next message
sQeKy
Messages: 24
Registered: July 2005
Junior Member
sQeKy wrote on Wed, 13 July 2005 02:36

All the calendar making procedures i have seen here use these library files...stndrd20.olb and calendar.pll
what if u want the active x .. calendar control 9.0 ... to make a calendar .. just in the same fashion ....
how to do that ?


OK is my question not clear here ... i need the solution ... please help
Re: OCX Calendar Control 9.0 [message #127916 is a reply to message #127908] Thu, 14 July 2005 02:24 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Question looks okay ... what you need is someone who has ever done it that way.

David
Re: OCX Calendar Control 9.0 [message #127989 is a reply to message #127916] Thu, 14 July 2005 08:39 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Never done it but I gave it a shot:

MSCAL.OCX walkthrough

This has been created with Forms6i (6.0.8.25.2) and MSCAL.OCX 8.0 (8.0.0.5007) on a Windows 2000 Professional box.

The following steps create a basic calendar form.

1. Create a Control Block (CALENDAR_BLOCK)
2. Create a Canvas (CAN$MAIN)
3. Import the MSCAL.OXC. To do so go to the menu "Program"->"Import OLE Library Interfaces". There you select "MSCAL.Calendar".

If it's not in the list, you'll need to register it through the command (Start->Run...): regsvr32 _full_path_of_the_ocx_file_\mscal.ocx. If you can't find it on your system, you can download it from the internet (I've done so).
Make sure you highlight both Method Package ICalendar and Event Package DCalendarEvents. Click OK. this should have created 5 program units.

4. Add an ActiveX control item (MS_CALENDAR) to your block. Set the Property "OLE Class" to "MSCal.Calendar" and the Property "Canvas" to "CAN$MAIN"

5. Go to the layout editor and right click on the item displayed there (MS_CALENDAR) and select "Insert object...". Click ok in the dialog (Check that calendar control 8.0 is highlighted).

6. Resize the object to view the control fully. Note: on my box, the initial display of the control was messed up. I resolved it by right clicking it and selecting "Calendar object"-> "Properties' and closing the dialog.

7. Add a text item (TXT_DATE_SELECTED)to the block and display it on your CAN$MAIN canvas. The data type is DATE.

8. Add an ON-DISPATCH-EVENT trigger to your MS_CALENDAR item.
I've added the following code to the double-click event:
DECLARE
  v_day    NUMBER;
  v_mon    NUMBER;
  v_year   NUMBER;
BEGIN
  v_day  := MSCAL_ICALENDAR.DAY(:ITEM('CALENDAR_BLOCK.MS_CALENDAR').Interface);
  v_mon  := MSCAL_ICALENDAR.MONTH(:ITEM('CALENDAR_BLOCK.MS_CALENDAR').Interface);
  v_year := MSCAL_ICALENDAR.YEAR(:ITEM('CALENDAR_BLOCK.MS_CALENDAR').Interface);
  :calendar_block.txt_date_selected :=
               TO_DATE (LPAD (TO_CHAR (v_day), 2, '0') || LPAD (TO_CHAR (v_mon), 2, '0') || TO_CHAR (v_year)
                      , 'DDMMYYYY');
END;

You can enter this code in a push-buttons 'WHEN-BUTTON-PRESSED' trigger or whatever you fancy. I'd suggest you take a close look at the MSCAL_ICALENDAR functions.
9. Compile and run. When you doubleclick a cell, the date gets displayed in TXT_DATE_SELECTED.

It should work, I've created it while typing.

I'm no OCX specialist but since it's a question that pops up from time to time I decided to give it a go. It's not that hard actually.

Remark: Don't ask me for MSCAL.OCX. I've just downloaded by entering "download MSCAL.OCX" in Google and selecting the first.


Regards,
MHE

[Updated on: Wed, 07 June 2006 07:29]

Report message to a moderator

Re: OCX Calendar Control 9.0 [message #128067 is a reply to message #127989] Thu, 14 July 2005 17:52 Go to previous messageGo to next message
Another Arbitrary Name
Messages: 23
Registered: July 2005
Junior Member
I am missing the point of this.......

What are the benifits of ActiveX over using Forms default functioanllity?
Or do you have too much free time?
Re: OCX Calendar Control 9.0 [message #128125 is a reply to message #128067] Fri, 15 July 2005 05:03 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Another Arbitrary Name wrote on Fri, 15 July 2005 00:52

I am missing the point of this.......

What are the benifits of ActiveX over using Forms default functioanllity?
Or do you have too much free time?

Hold your horses!

Default functionality? You have to add some extras manually, whether you use a Forms solution (PLL/OLB) or an ActiveX control. Nothing 'default' about that. But you meant 'native' I assume. If so, I agree: don't use a feature just because it exists.

Look at it this way.
It's usually from an end-users' point of view that such a feature is demanded.

Once key users convince the project management that they 'need' it, there's always a chance you have to build it. What I usually do in such a situation comes down to your remark: I ask what benefits that would have over a native Forms solution. I've noticed that it comes down to 'it looks better' or variants. It's true that ActiveX controls tend to have gizmo's or features that seem nice but they can't beat the maintainability of a native Form.

it's just an example how to include an ActiveX control ( might you ever need one). Similarly you can use an ActiveX for Macromedia Flash in a Form.

MHE

BTW: The example was built in 15 minutes (and that includes the OCX download).

[Updated on: Fri, 15 July 2005 05:05]

Report message to a moderator

Re: OCX Calendar Control 9.0 [message #128188 is a reply to message #128125] Fri, 15 July 2005 10:55 Go to previous messageGo to next message
Another Arbitrary Name
Messages: 23
Registered: July 2005
Junior Member
Good reason as any.

Thanks for the info. I guess I am getting too used to telling the users what they can and can't have.
Re: OCX Calendar Control 9.0 [message #128242 is a reply to message #127752] Sat, 16 July 2005 01:22 Go to previous messageGo to next message
sQeKy
Messages: 24
Registered: July 2005
Junior Member
Minor Error:

when i use the pop down menu for months and years
it gives an error

FRM-40735 ON-DISPATCH-EVENT trigger raised and unhandled exception ORA-01847

:S

btw i had calendar control 9.0
Re: OCX Calendar Control 9.0 [message #128247 is a reply to message #127752] Sat, 16 July 2005 02:16 Go to previous messageGo to next message
sQeKy
Messages: 24
Registered: July 2005
Junior Member
Addendum :

Also at runtime the control has to inserted again :S
i want the calendar to be visualy on the form when my form loads :S
Re: OCX Calendar Control 9.0 [message #183729 is a reply to message #128247] Sat, 22 July 2006 14:18 Go to previous messageGo to next message
wael890610
Messages: 17
Registered: June 2005
Location: Egypt-Ismaelia
Junior Member

Also at runtime the control has to inserted again :S
i want the calendar to be visualy on the form when my form loads :S
icon4.gif  Re: OCX Calendar Control 9.0 [message #208280 is a reply to message #183729] Sat, 09 December 2006 01:00 Go to previous messageGo to next message
sat14nov
Messages: 2
Registered: December 2006
Location: delhi
Junior Member
although this is an older message,but i need it urgently.

every thing is working fine , but at runtime, container becomes blank. i mean, i have to insert activex(.ocx) again at runtime.

kindly suggest me.

thanks in advance.



Re: OCX Calendar Control 9.0 [message #208462 is a reply to message #208280] Mon, 11 December 2006 00:12 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
What version of Forms are you using? I suggest searching for 'calendar' and looking at a more recent thread. Go to the Oracle Form site and look at the Calendar demos.

David
Re: OCX Calendar Control 9.0 [message #601259 is a reply to message #208462] Mon, 18 November 2013 23:25 Go to previous messageGo to next message
Adeel Qadir
Messages: 48
Registered: November 2013
Location: Pakistan
Member
MSCAL.OXC is not found in object list ????
Re: OCX Calendar Control 9.0 [message #601292 is a reply to message #601259] Tue, 19 November 2013 04:25 Go to previous message
mughals_king
Messages: 392
Registered: January 2012
Location: pakistan
Senior Member
you want MSCAL.FMB file
Previous Topic: Form Personalization "Do you Want to Save the Changes You Have Made?"
Next Topic: How to remove tile -[WIN_MAIN] at runtime
Goto Forum:
  


Current Time: Fri Mar 29 08:09:57 CDT 2024