Changing a get picture at runtime

Changing a get picture at runtime

Postby Marco Turco » Tue Jan 20, 2009 9:45 am

Hi all,
I'm trying to change a get picture at runtime but unsuccessfully.

In this self-contained sample I have a get initialized with a euro picture (9999.99),
then pressing the "Lire picture" button I would like to change the picture in the 999999 format but it doesn't change.

Any suggest ?

Thanks in advance.

function Main()

local oDlg, oGet, oBtn

nTest:=0
cPicture:="9999.99"

DEFINE DIALOG oDlg TITLE "A simple GET" ;
FROM 2, 2 TO 13, 40

@ 10, 10 GET oTEST1 VAR nTest SIZE 120, 13 pixel OF oDlg RIGHT PICTURE cPicture

@ 3, 4 BUTTON oBtn PROMPT "Euro picture" SIZE 45, 12 OF oDlg ;
ACTION ( cPicture:="9999.99", oTest1:Refresh())

@ 3, 14 BUTTON "Lire picture" SIZE 45, 12 OF oDlg ;
ACTION ( cPicture:="999999", oTest1:Refresh())

ACTIVATE DIALOG oDlg CENTERED

return nil
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Re: Changing a get picture at runtime

Postby stefano » Tue Jan 20, 2009 10:21 am

Ciao,
Io ho risolto così

@10,1.5 GET oImpdef VAR cImpdef OF oDlg picture if(euro = 1,"@E 99,999,999.99","@E 9,999,999,999") valid somma() SIZE 50,10

Stefano
FWH 14.11 + xHarbour + bcc582
stefano
 
Posts: 80
Joined: Tue Mar 25, 2008 9:03 pm
Location: ITALIA

Re: Changing a get picture at runtime

Postby Enrico Maria Giordano » Tue Jan 20, 2009 10:28 am

Oppure

Code: Select all  Expand view
ACTION ( oTest1:oGet:Picture:="999999", oTest1:Refresh())


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Changing a get picture at runtime

Postby sambomb » Tue Jan 20, 2009 11:44 am

Enrico Maria Giordano wrote:Oppure

Code: Select all  Expand view
ACTION ( oTest1:oGet:Picture:="999999", oTest1:cPicture:="999999", oTest1:Refresh())

:wink:
EMG
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: Changing a get picture at runtime

Postby Enrico Maria Giordano » Tue Jan 20, 2009 12:59 pm

Please, take the time to try the suggestions. There's no need to assign cPicture property.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Changing a get picture at runtime

Postby Marco Turco » Tue Jan 20, 2009 10:08 pm

Hi Enrico,
your solution give me an "message not found" error in the tget class.
The only running solution I have found is the following but there is a problem with the picture refresh. The picture change only when I select the get with the mouse.

Any ideas ?

---------

Function Main()
local oDlg, oGet, oBtn
nTest:=0
cPicture:="9999.99"

DEFINE DIALOG oDlg TITLE "A simple GET" ;
FROM 2, 2 TO 13, 40

@ 10, 10 GET oTEST1 VAR nTest SIZE 120, 13 pixel OF oDlg RIGHT PICTURE cPicture

@ 3, 4 BUTTON oBtn PROMPT "Euro picture" SIZE 45, 12 OF oDlg ;
ACTION ( oTest1:cPicture:="9999.99", oTest1:Refresh())

@ 3, 14 BUTTON "Lire picture" SIZE 45, 12 OF oDlg ;
ACTION ( oTest1:cPicture:="999999", oTest1:Refresh())

ACTIVATE DIALOG oDlg CENTERED

return nil
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Re: Changing a get picture at runtime

Postby Enrico Maria Giordano » Tue Jan 20, 2009 10:58 pm

The following sample works fine here:

Code: Select all  Expand view
#include "Fivewin.ch"


function Main()

local oDlg, oBtn, nTest, cPicture, oTest1

nTest:=0
cPicture:="9999.99"

DEFINE DIALOG oDlg TITLE "A simple GET" ;
FROM 2, 2 TO 13, 40

@ 10, 10 GET oTEST1 VAR nTest SIZE 120, 13 pixel OF oDlg RIGHT PICTURE cPicture

@ 3, 4 BUTTON oBtn PROMPT "Euro picture" SIZE 45, 12 OF oDlg ;
ACTION ( oTest1:oGet:Picture:="9999.99", oTest1:Refresh())

@ 3, 14 BUTTON "Lire picture" SIZE 45, 12 OF oDlg ;
ACTION ( oTest1:oGet:Picture:="999999", oTest1:Refresh())

ACTIVATE DIALOG oDlg CENTERED

return nil


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Changing a get picture at runtime

Postby Marco Turco » Wed Jan 21, 2009 6:46 pm

Yes. It runs fine.

Thanks a lot.
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 58 guests