Page 1 of 1

Special Run to update Title

Posted: Fri May 24, 2019 7:55 am
by omni
Roger,

we did this 12 years ago so i know you will remember vividly. (kidding)

The user wants a constant notification that a process is running, so we added it to the Title on our app so the users would always see the last date /time run. Related to EDI running on one of our EXE's. Sometimes it just errors out and they are now aware it stops.

Tried to activate without each user needing to activate but failed. Had to put it on the menu. Otherwise it gives a message the the dlg does not exist (yet).

Here is what we did.
This works..
for the title we use:
Title {||qqtittle }

Standard mdiblock (removed my special codes as not relevant)

STATIC PROCEDURE MDIBlock( bAction, ctitle )

LOCAL oThread, aChildList := oMainDialog:drawingArea:childList()

setappfocus(odlg)
oThread := Thread():new()
close all
RETURN

//this is the procedure
Static Function edix(getlist)


do while .t.

use edilog
goto bott
store date to xxxxdate
store time to xxxxtime
use
qqedidate='(Last EDI Update: '+ dtoc(xxxxdate)+' '+substr(xxxxtime,1,5)+")"
qqTitle= 'MAIN MENU'+' '+alltrim(QCOMPNAME)+' '+qqedidate

dc_getrefresh(getlist)
oDlg:SetTitle(qqtitle)
keyin=inkey(500)


enddo


Is the any other method to start automatically when the app is first opened by each user as part of the DCREAD GUI, other than them doing the menu option

Fred
OMNi

Re: Special Run to update Title

Posted: Fri May 24, 2019 8:24 am
by rdonnay
Call it from the EVAL bBlock clause of DCREAD GUI.

DCREAD GUI .. EVAL {||EditX(GetList)}

Re: Special Run to update Title

Posted: Fri May 24, 2019 9:05 am
by omni
Got that to work, but then the exit option on the menu will not work. Guess its due to the one item running, but if I add it to the menu that is not an issue.
We use the exit to move to another company (changes default directory) and it will not close. Using the menu works properly.
Do I need to add something else?

DCREAD GUI ;
TITLE {||QQTITLE } ;
PARENT @oDlg ;
Nodestroy ;
To mStatus ;
OPTIONS GetOptions ;
EVAL {|o|SetAppWindow(o),M->oMainDialog := o, ;
o:setFrameState(XBPDLG_FRAMESTAT_MAXIMIZED ), ;
bitmapConfig(odlg),odlg:show(),EdiX(GetList) } ;

Re: Special Run to update Title

Posted: Fri May 24, 2019 10:13 am
by rdonnay
I need to see more of your code to understand why this doesn't work.