PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → Event handling for a runtime created button
Event handling for a runtime created button
Started by Hans VINCKIER, Nov., 02 2024 1:32 PM - 4 replies
Registered member
2 messages
Posted on November, 02 2024 - 1:32 PM
Hi,
I've been working in Clarion since 1996 and now we want to start moving our app to windev. First we'll try to find out how we can move our working principles.
The application controls access , payment, weigh registration for a containerpark. Each cabinet has a card reader, payment terminal, printer... For each type of cabinet or function there is a class object. Screen setup is done at runtime,i.e. all controls are created when the program starts by reading a configuration file.
I found how to create buttons, etc at runtime. Now, several buttons are repeated on screen. In the called procedure (when the button is clicked) I want to know which button activated the call.
I asked chatgpt and copilot and both suggested the "eventsource()" procedure. I didn't find any docs on that, even via the help it seemed to be an unknown function.
How can I find out which control activated the call ??

Thanks

Hans Vinckier
Posted on November, 08 2024 - 3:09 PM
Hans VINCKIER wrote:
Hi,
I've been working in Clarion since 1996 and now we want to start moving our app to windev. First we'll try to find out how we can move our working principles.
The application controls access , payment, weigh registration for a containerpark. Each cabinet has a card reader, payment terminal, printer... For each type of cabinet or function there is a class object. Screen setup is done at runtime,i.e. all controls are created when the program starts by reading a configuration file.
I found how to create buttons, etc at runtime. Now, several buttons are repeated on screen. In the called procedure (when the button is clicked) I want to know which button activated the call.
I asked chatgpt and copilot and both suggested the "eventsource()" procedure. I didn't find any docs on that, even via the help it seemed to be an unknown function.
How can I find out which control activated the call ??

Thanks

Hans Vinckier


i am not sure, if I realy understand your problem. I work and was working with Clarion since 198? and now I am on with WinDev too - aprox. 2 or 3 years. My colleague here is an experient WinDev developer ans portet a lot of Clarion code to WinDev. If you provide me some Clarion code snippets, maybe we can help you...

Regards
Registered member
125 messages
Posted on November, 11 2024 - 9:36 AM
Usually points the MySelf-Variable to the Control, for which the event-Process is currently run ...
Registered member
2 messages
Posted on November, 18 2024 - 5:02 PM
HI,

In clarion it works as follows :
A driver procedures creates several objects? These objects create controls on the screen of the driver procedure. When a button is clicked, the event handler in the driver procedure intercepts this event and can handle it.
Now, these objects also start ip communication with other systems. The objects are derived from a nettalk object. This means that the driver procedure calls at regular times the event handler in the object to check the condition of the nettalk communication object.
So I'm wondering how this works in windev. I.e. : an object receives a message : how is the receipt handled , a method in the windev object ? How is this activated, does the driver procedure call:activate some funtions at regular time ?

Thanks

Hans Vinckier
Registered member
82 messages
Posted on November, 18 2024 - 8:47 PM
Hi

Why not just add a parameter indicating which button did the calling?


Hans VINCKIER wrote:
Hi,
I've been working in Clarion since 1996 and now we want to start moving our app to windev. First we'll try to find out how we can move our working principles.
The application controls access , payment, weigh registration for a containerpark. Each cabinet has a card reader, payment terminal, printer... For each type of cabinet or function there is a class object. Screen setup is done at runtime,i.e. all controls are created when the program starts by reading a configuration file.
I found how to create buttons, etc at runtime. Now, several buttons are repeated on screen. In the called procedure (when the button is clicked) I want to know which button activated the call.
I asked chatgpt and copilot and both suggested the "eventsource()" procedure. I didn't find any docs on that, even via the help it seemed to be an unknown function.
How can I find out which control activated the call ??

Thanks

Hans Vinckier


--
Ben Dell
Riebens Computers Pty Ltd
Southern Africa PcSoft Distributor
www.windevsa.co.za
PcSoft Sales, Support and Training