Page 1 of 1

Change BOX content

Posted: Thu Jan 22, 2009 7:34 pm
by yardenmo
Hi,

On a main screen that shows few buttons, I need to create another button which, when clicking it, it will show another permanent BOX / SAY with a string. Each click changes the string in the box from "DISCHARGE" <--> "LOAD". I don't want to draw all the screen on each click, but the string in the box.


The main screen is drawn using:
@ 0, 0 BTNBMP NAME "setup" SIZE 40, 30 OF oWnd ACTION TalySetupMain()

@ 0, 40 BTNBMP NAME "DschLoad" SIZE 40, 30 OF oWnd ACTION TalyHeadMain()

@ 0, 80 BTNBMP NAME "shfting" SIZE 40, 30 OF oWnd ACTION TalyContShifting()

@ 0, 120 BTNBMP NAME "empty" SIZE 40, 30 OF oWnd ACTION ( cFSE := "EMPTY", TalyContMain() )



Thanks,
Moshe Yarden

Re: Change BOX content

Posted: Fri Jan 23, 2009 9:30 am
by yardenmo
Hi,

If I need just to show a string somewhere on the screen, how can I use the SAY command?

I'm trying:
@ 0, 0 BTNBMP NAME "setup" SIZE 40, 30 OF oWnd ACTION TalySetupMain()

@ 0, 40 BTNBMP NAME "DschLoad" SIZE 40, 30 OF oWnd ACTION TalyHeadMain()

@ 0, 80 BTNBMP NAME "shfting" SIZE 40, 30 OF oWnd ACTION TalyContShifting()

and:
@ 0, 40 SAY "I022345" OF oWnd //BOX //cManifest

The buttons do work, but the SAY is not shown.

What do I do wrong?


Thanks,
Moshe Yarden

Re: Change BOX content

Posted: Fri Jan 23, 2009 10:28 am
by Enrico Maria Giordano
The following sample works fine here:

Code: Select all

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd

    DEFINE WINDOW oWnd

    @ 1, 1 SAY "This is a test"

    ACTIVATE WINDOW oWnd

    RETURN NIL
EMG

Re: Change BOX content

Posted: Fri Jan 23, 2009 12:49 pm
by yardenmo
Thanks EMG,

Now it is shown. I've used row and column like in BTNBMP.

I'm trying to use the SAY and then redefine it (with each click, on another button)
When trying:
@ 4, 10 SAY oSay cManifest OF oWnd COLOR nRGB( 255, 255, 255 ), nRGB( 0, 255, 0 )
I receive: "syntax error at '@'"
Using SAY without oSay works:
@ 4, 10 SAY cManifest OF oWnd COLOR nRGB( 255, 255, 255 ), nRGB( 0, 255, 0 )

Bit then I don't know how ro use redine from an outer function.


Thanks,
Moshe Yarden

Re: Change BOX content

Posted: Fri Jan 23, 2009 4:22 pm
by Enrico Maria Giordano

Code: Select all

@ row, col SAY oSay PROMPT cManifest ...
EMG