Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
3
Erster Beitrag:
vor 3 Jahren, 3 Monaten
Letzter Beitrag:
vor 3 Jahren, 3 Monaten
Beteiligte Autoren:
Curtis, Stefan Bentvelsen

[WD20] Schedule Control - Preventing Default Process [SOLVED]

Startbeitrag von Curtis am 01.05.2015 18:51

I have a schedule control. When I right click an appointment and select modify the appointment turns into a temporary edit field. When I right click and select new appointment, the new appoinment turns into a temporary edit field.

I am trying to find a way to prevent this. When I right click and select new appointment I want to bring up my own appointment form. The code for this is below. The problem is after the call to FillSchedule() the code moves on to the 'Entry in edit in an appointment' process and turns the appointment into the temporary edit that I don't want. I've tried sending keys and mouse clicks, but it seems that code happens before the appointment is turned into an edit.

I want to do the same thing with edit/modify. Does anyone know how I can prevent this default behavior?


PROCEDURE BeforeCreation(aptCreated is Appointment)

IF Open(WIN_Form_Task,True,0,Left(aptCreated.StartDate,8)) THEN
FillSchedule()
ELSE
// This code succesfully removes the temporary edit field if the new appointment/task was cancelled
ExecuteProcess(MySelf,trtDeleteScheduleApt, aptCreated)
END

PROCEDURE EnterInInput(aptEdited is Appointment)

SendKey("{ESC}")

Antworten:

Re: [WD20] Schedule Control - Preventing Default Process

Hi Curtis,

if you use the code:

Result False

in the code-events of the scheduler, you can stop the action.
And there are some possebilities in the 7-tabs to disable some actions.
Hope it helps you.

von Stefan Bentvelsen - am 01.05.2015 20:42
Awesome. I had been unsuccessfully trying to use RETURN. Thanks Stefan!

Unchecking 'Allow the direct input on an appointment' easily fixed my problem.

Before I unchecked that option I also got it to work with this code:

PROCEDURE EnterInInput(aptEdited is Appointment)

nTaskID is int = aptEdited.ID

IF nTaskID > 0 THEN
// Modifying
IF Open(WIN_Form_Task,False,nTaskID,Left(aptEdited.StartDate,8)) THEN
FillSchedule()
END
ELSE
// Creating
HReset(Task)
IF Open(WIN_Form_Task,True,0,Left(aptEdited.StartDate,8)) THEN
FillSchedule()
ELSE
ExecuteProcess(MySelf,trtDeleteScheduleApt, aptEdited)
END
END

RESULT False // Prevents appointment from becoming temporary edit field


von Curtis - am 01.05.2015 21:08
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.