Automatic Update to TitleBar Control

Started by James Zukowski, March 25, 2022, 03:31:16 PM

Previous topic - Next topic

James Zukowski

We've got a TitleBar that includes a Multi_Line for the current time. We're currently "manually" updating that at the end of a part of a process by assigning the Time$ and setting Refresh_Flg=1.
Does anyone know of a way to trigger a routine call for that variable/control to be automatically updated whenever the screen refresh logic is processed? (Don't want to use the Timer trigger.)

Thanks!
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

Stéphane Devouard

James

Just thinking out loud here, haven't tested but you may try using the Dependency Definitions and set the Time$ variable when refresh_flg = 1

Hope this helps
Stéphane Devouard
Portfolio | Work

Mike King

James

Can you provide more details of what you are looking for?

Do you want the timer updated only after the uses does something on the screen?
Do you want the timer updated every second? minute?
Are you using WindX or a local Windows application or something like Terminal server/RDP?

One thing you could do instead of a multi-line on the title, use a small *browser control with an HTML page that simply displays the time.  It can be set to run independently -- and if you aren't running Terminal Server/RDP should have no impact to network traffic.

Actually if you use *browser and HTML you can stylize the timer -- you could even display the time as an analog clock.  Using HTML would also allow you to include additional information such as weather, stock values, probably even email notifications.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

James Zukowski

Stéphane:
Neat idea. Unfortunately, Dependencies are processed just before the input loop waiting for events. That's also after any logic has been processed and Refresh_Flg has been reset to 0.

Mike:
We're just updating the text Multi_Line with the current server time. Currently, this only happens when we include the assignment after some processing has been done. I'd like it to update when any of the fields have been updated, rather than "remembering" to do so. That's more like when the user does something on the screen. We're using WindX, though I'm not sure of the exact configuration (I'm fairly new at this position).
We're keeping it simple, as this is the TitleBar for the application programs. Including an analog clock or other web-based info would not be appropriate here.
Thanks for your consideration!
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

Mike King

James,

If you do decide to try a HTML clock, here is some simple code you can place on a web site or file that will be accessible by your application.

<html><head><script>
function showtime()
{ var today = new Date();
document.getElementById('clock').innerHTML = today.getHours() + ":" + ("0"+today.getMinutes()).slice(-2) + ":" + ("0"+today.getSeconds()).slice(-2);
}
</script>
<style>
body { border: 2px inset Silver; margin: 0; background: #EEE;}
#clock { text-align: center;
</style></head>
<body onload='setInterval(showtime,1000);'>
<div id='clock'>&nbsp;</div></body></html>


Simply create a 10w x 1.5h *browser control pointing to the above HTML and presto you have a free standing clock that will run locally.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

James Zukowski

From what I gather, there's nothing that would automatically trigger a refresh/reload of that field from Nomads aside from a Timer trigger. And that would have to be in the main window, not the TitleBar window definition.

Our date format in this field is: 02:46 pm EST (or EDT)
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

Mike King

I'm not certain what you mean by your first statement. 

If you want an automatic update of your screen every minute (since that's the resolution of the time you want), the easy solution is in your title bar add some logic to set %nomads'timeout to 60 and define user_ctl logic for -1900 that simply updates the time.

Personally I wouldn't do this if you are running a number of users remotely on WindX as each user process will then generate an exchange every 60,  so if you have 60 users on the system each with 4-5 processes that would generate 4-5 packets every second just to keep the timers accurate.

This is one reason I suggested creating a simple *browser control which updates locally. 

Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com