Change BOX content

Post Reply
yardenmo
Posts: 33
Joined: Tue Aug 12, 2008 7:08 am

Change BOX content

Post 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
yardenmo
Posts: 33
Joined: Tue Aug 12, 2008 7:08 am

Re: Change BOX content

Post 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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Change BOX content

Post 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
yardenmo
Posts: 33
Joined: Tue Aug 12, 2008 7:08 am

Re: Change BOX content

Post 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
Post Reply