sbutton refresh : to manuel mercado

sbutton refresh : to manuel mercado

Postby Silvio » Sat Aug 09, 2008 9:38 am

Manuel,
I making an application for a restaurant and Icreate a plan with many button to simulate the tables
Image
on each button I link a menupopup where the use can select many functions .
On these function I must refresh caption and tooltip of all buttons
the captions are refresh but not the tooltip


on my application I made :

Code: Select all  Expand view  RUN
cCaption :=  cf( (oDTavoli)->data_pre)+CRLF+;
                              Str2Lines( alltrim((oDTavoli)->prenotazio), " " )+CRLF+ ;
                              "n."+str( (oDTavoli)->posti)+CRLF+;
                              transform(left( alltrim((oDTavoli)->Orario),5),"99:99")

              cCaption_est := "Tavolo n."+ alltrim(str( (oDTavoli)->numreg))+CRLF+;
                              "prenotato per il giorno "+cf( (oDTavoli)->data_pre)+CRLF+;
                              "dal sig/ra "+Str2Lines( alltrim((oDTavoli)->prenotazio), " " )+CRLF+ ;
                              "per posti n."+str( (oDTavoli)->posti)+CRLF+;
                              "per le ore "+ transform(left( alltrim((oDTavoli)->Orario),5),"99:99")+" circa."


                  @Fila, (Col+nPassLarg)  SBUTTON aBtn[Sil] OF oApp():oDlg  FONT oFontTavoli ;
                SIZE 50, 40 PIXELS ;
                PROMPT cCaption  ;
                BORDER ;
                TOOLTIP (  cCaption_est) ;
                MESSAGE ( (oDTavoli)->nome) ;
                COLORS CLR_BLACK, CLR_HBLUE ;
                TEXT ON_CENTER OFFICE   UPDATE







I made this function to refresh all buttons ( they are 300) :

stat func rinfresca( oDlg,oBtn)
Local nI
FOR nI=4 TO Len(oDlg:aControls)
oDlg:aControls[nI]:Refresh()
oBtn[nI]:Refresh(.t. ) ---> it give me error ..why?
NEXT nI
oDlg:Refresh()
RETURN (NIL)


any Idea ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby James Bott » Sat Aug 09, 2008 12:49 pm

Silvo,

It is not clear what you are doing.

Code: Select all  Expand view  RUN
stat func rinfresca( oDlg,oBtn)
Local nI
FOR nI=4 TO Len(oDlg:aControls)
oDlg:aControls[nI]:Refresh()
oBtn[nI]:Refresh(.t. ) ---> it give me error ..why?
NEXT nI
oDlg:Refresh()
RETURN (NIL)


In the above you are passing oBtn. Is this supposed to be aBtn, an array, or is it just a single button object?

I don't see why you even need this function. If you DEFINE or REDEFINE all the buttons with the UPDATE clause, then all you need to do to refresh all the buttons is do oDlg:update().

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Silvio » Sat Aug 09, 2008 2:04 pm

i SENT YOU A TEST
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 30 guests