Fivewin controls similar to javascript elements

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!

Fivewin controls similar to javascript elements

Postby Otto » Tue Nov 21, 2023 7:33 am

Dear friends,
I asked ChatGPT for tutoring:
I use FiveWin, and it appears to be based on C++. In this environment, we utilize controls similar to elements. However, these controls consume events,
necessitating their forwarding to the superclass. To me, the Windows queue seems to bear a strong resemblance to the DOM object.

Understanding these similarities and differences can be quite useful when transitioning between web and desktop application development.
The conceptual model of event handling is a key aspect of interactive application design in both environments,
even though the specific implementations and best practices may differ.

Best regards,
Otto



Event Handling in Windows Programming:
Message Queue: Windows applications operate on a message-driven architecture. The operating system dispatches messages (like mouse clicks, key presses, etc.) to applications, which are then handled by the application's message loop. This is somewhat analogous to events in the JavaScript DOM, where events are dispatched to nodes in the DOM tree.

Event Listeners/Handlers: In both Windows applications (including those developed with FiveWin) and JavaScript, you typically attach event listeners (or handlers) to specific controls (in FiveWin) or elements (in JavaScript). These listeners respond to specific events, such as clicks or key presses.

Propagation: In JavaScript, events can bubble up the DOM tree, allowing parent elements to handle events triggered on their children. In Windows programming, a similar concept exists where messages not handled by a control can be passed to the parent window or a default window procedure for handling.

Subclassing Controls: In FiveWin and traditional Windows API programming, subclassing controls is a common practice. This involves intercepting messages intended for a control to implement custom behavior before possibly passing them on to the control's original procedure (similar to calling a superclass method). This is somewhat parallel to overriding event handlers in JavaScript.

Differences:
Language and Environment: JavaScript is a scripting language primarily used for web development, while FiveWin is a toolkit used with C++ for desktop application development. This leads to differences in how events are processed and handled.

System-Level vs. Application-Level: In Windows programming, you're often dealing with system-level messages and events, whereas in JavaScript, you're typically dealing with events at the web application level.

Direct vs. Delegated Handling: JavaScript allows for easy delegation of event handling (e.g., attaching an event listener to a parent element for events triggered by its children). In Windows programming, while similar behavior can be achieved, it often requires more explicit message routing.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6364
Joined: Fri Oct 07, 2005 7:07 pm

Re: Fivewin controls similar to javascript elements

Postby Enrico Maria Giordano » Tue Nov 21, 2023 9:55 am

Otto wrote:I use FiveWin, and it appears to be based on C++.


[x]Harbour and FWH are based on C language, not C++. Only a few contribs modules require C++ language.
User avatar
Enrico Maria Giordano
 
Posts: 8724
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Fivewin controls similar to javascript elements

Postby Otto » Tue Nov 21, 2023 1:07 pm

Thank you, Enrico, I just think it's important that as an HTML and JavaScript programmer
one makes comparisons, to understand what one is doing. Particularly,
I believe that EVENTHANDLERS are more universal, and in Fivewin,
by extensively using ::Super:, the possibilities in screen design can significantly increase.


Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6364
Joined: Fri Oct 07, 2005 7:07 pm


Return to mod_harbour

Who is online

Users browsing this forum: No registered users and 4 guests