Page 1 of 1

Says that don't say, Problem upodating Button cCaptions etc

Posted: Tue Jul 10, 2007 10:44 pm
by xProgrammer
I am writing a program to control the workflow of Word Documents. I am just using a single (main) window (oWnd). I have a timer set to check if there are any files to be edited by that user. I wanted to alert the user, preferably by changing the caption and color of a button - or at least changing the text of a SAY. I looked at testime.prg annd thought it would be straight forward but no. In fact testtime as in the samples doesn't work! The timer fires no doubt but the oWnd:Say(.......) doesn't do anything. In fact I can't even get a SAY to work on the main window at all - let alone change its caption. Is this normal? I can get a Button to work and the timer can alter its caption (I think) because oMyButton:cCaption:= doesn't giva an error but the caption as displayed doesn't alter and calling oMyButton:Paint() also doesn't help and calling oMyButton:Initiate(oWnd) crashes. The timer is firing (alerts work fine). The timer can successfully SET MESSAGE which is my solution of last resort, but can anyone help with either updating the caption on the button or explaining why Says don't seem to work on the main window at all. Should testtime.prg compile and ruin as suggested or is it a sample that noone checked?

Thanks

xProgrammer

Posted: Wed Jul 11, 2007 8:05 am
by Antonio Linares
samples\TestTime.prg is properly working, the problem is that uses white color so you can't see it :-)

Simply change the color of the window:

DEFINE WINDOW oWnd FROM 3, 3 TO 20, 50 ;
TITLE OemToAnsi( "Testing timers" ) ;
MENU BuildMenu() COLOR "W+/B"

Posted: Wed Jul 11, 2007 11:33 am
by xProgrammer
Thanks Antonio for your prompt answer. Will try. Buttons must have different color defaults because they show up. This certasinly looks like a solution, but is there a way to

1> Change the caption of a Button

2> Change the (background) color of a button

which I would like to do.

Also is there a simple way to change gets from read only to normal when you want to put an enquiry dialog into edit mode. Currently I am redefining the dialog.

Thanking you

xProgrammer

Posted: Thu Jul 12, 2007 7:26 am
by StefanHaupt
1: oBtn:Settext(...)

2: AFAIK you canĀ“t change the color of standard buttons. You can try to use the TsButton-class

REDEFINE oGet VAR ...
oGet:Enable() or oGet:Disable()

Posted: Thu Jul 12, 2007 8:02 am
by xProgrammer
Thanks for your help Stefan. Prgressing well today.

Regards

xProgrammer