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

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

Postby xProgrammer » Tue Jul 10, 2007 10:44 pm

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
User avatar
xProgrammer
 
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Postby Antonio Linares » Wed Jul 11, 2007 8:05 am

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"
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby xProgrammer » Wed Jul 11, 2007 11:33 am

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
User avatar
xProgrammer
 
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Postby StefanHaupt » Thu Jul 12, 2007 7:26 am

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()
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Postby xProgrammer » Thu Jul 12, 2007 8:02 am

Thanks for your help Stefan. Prgressing well today.

Regards

xProgrammer
User avatar
xProgrammer
 
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 43 guests