Thank you Mr.Antonio
1) Is it poosible to show the time in MsgBar in AM/PM Format. Right now I understand that it is possible only in the 24 hr format.
Regarding the AM/PM format in Clock on MsgBar, I included a modified \C:\FWH\source\classes\MsgBar.Prg version on my Application prg's and added the modified MsgBar.PRG in my .rmk file. It is working fine
METHOD ClockOn() CLASS TMsgBar
local cTime := Time()
if ::oClock == nil
// keep the ':=' below for XBase++ compatibility
::oClock := TMsgItem():New( Self, cTime, ::GetWidth( cTime ) + 18,,,, .t.,;
{ || WinExec( "Control date/time" ) } )
::oClock:lTimer = .t.
[b]::oClock:bMsg = { || AMPM(Time()) }[/b]
endif
::CheckTimer()
return nil
*---------------------------------------*
function AMPM( cTime )
*---------------------------------------*
local nHour
if ( nHour := Val( SubStr( cTime, 1, 2 ) ) ) > 11
cTime = PadL( AllTrim( Str( nHour - 12 ) ), 2, "0" ) + SubStr( cTime, 3 ) + " PM"
else
cTime += " AM"
endif
return cTime
Would be better if you could include this option in the next version. So that the prgrammer can pass a parameter AMPM to display time in AMPM format in the MsgBar
3) I would also like to know how to change the Text/Prompt of an already added msg item
fwh\samples\TestMsg3.prg helped me to solve
if oWnd:oMsgBar:GetItem() < 3
oItem := TMsgItem():New( oWnd:oMsgBar, cDispFnStr,110, ,"R*/BG",;
,.t., ,,, "Active Financial Year" )
oItem:bAction:={ || SelYear()}
else
[b]oWnd:oMsgBar:aItem[3]:cMsg:=cDispFnStr[/b]
Endif
OR
DEFINE MSGITEM cDispFnStr OF oWndEdit:oMsgBar SIZE 30 COLOR "R+/W" TOOLTIP "Active Financial Year" ACTION SelYear()
2) Any working sample code showing how to insert a new msg item at a desired position in MsgBar.
Unfortunately I could not find any sample to Insert a MsgItem at a desired position.