PFC Guide Titlebar
HomeFAQLinksPFCMAGExtensionsDownloadWhat's NewSearch

DropDown Calculator / Calendar Service FAQ

Table of Contents

  1. When using the Drop Down Calculator or Calendar service I loose the edit field format and other settings.

When using the Drop Down Calculator service I loose the edit field format and other settings.

The drop down calculator and calendar may be registered with three possible options:

When the DDLB or the DDLB_WITHARROW option is used ro register a datawindow column with the user object, the function will use Modify() to change the column edit style.   This will reset any edit settings configured in the datawindow painter.  How do you avoid this undesirable effect?  Don't let the PFC service change the edit style, do it yourself!  There are two ways of doing this.

If you know which columns will have the DDCalculator or DDCalendar "edit style" go ahead and set the column edit style to DDLB or DDLB_WITHARROW in the datawindow painter.   Then you can register the column using the NONE option.   This will tell the PFC service "Hey! Don't touch the edit style, I've already done it myself." 

Please note that the DDCalculator or DDCalendar display is triggered from the datawindow dropdown user event, which is mapped to pbm_dwndropdown.  The pbm_dwndropdown is fired when the user clicks on the DDLB or DDDW arrow, so code to trigger the calendar / calculator "drop" is not needed.

Here is a code sample:

this.iuo_calendar.of_Register("salary", this.iuo_calendar.NONE)

A second approach is to add a button to simulate the drop down arrow, and leave the column as edit or editmask edit style.  This is the only valid approach for an editmask edit style when changing it to DropDownListBox is not an option.  The end result is shown below:

The Start date column was configured as a DDLB_WITHARROW, while Salary is a standard edit edit style with a picture button on the right.  Can you tell the difference?   A single line border around the column helps the illusion.

This time however the dropdown user event (pbm_dwndropdown) will not fire so you will have to add some code to "drop" the calendar or calculator when the appropriate button is clicked.

// Datawindow buttonclicked event
IF = "salary_arrow" THEN 
	IF this.SetRow(row) = 1 AND this.SetColumn("salary") = 1 THEN 
		this.event pfc_ddcalculator() 

  Here is a sample dropdown bitmap 

This approach may be taken one step further and coded generically in the datawindow ancestor or the drop down service.  You have to standardize on the button name and suffix.  Something like <column_name>_calcarrow and <column_name>_caldarrow

Contributed by PFCGuide staff, except where noted otherwise.
PFCGuide is sponsored by Dynamic Technology Group
The information provided is for advice only and not to be considered a contract or a liability against Dynamic Technology Group.

Last revised: February 15, 2004 03:58 AM.