OCX Calendar Control 9.0 [message #127752] |
Wed, 13 July 2005 02:36 |
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 |
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 #127989 is a reply to message #127916] |
Thu, 14 July 2005 08:39 |
|
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 #128125 is a reply to message #128067] |
Fri, 15 July 2005 05:03 |
|
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 #128242 is a reply to message #127752] |
Sat, 16 July 2005 01:22 |
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
|
|
|
|
|
|
|
|
|