FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour sbutton refresh : to manuel mercado
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
sbutton refresh : to manuel mercado
Posted: Sat Aug 09, 2008 09:38 AM
Manuel,
I making an application for a restaurant and Icreate a plan with many button to simulate the tables

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 :

 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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
sbutton refresh : to manuel mercado
Posted: Sat Aug 09, 2008 12:49 PM
Silvo,

It is not clear what you are doing.

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
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
sbutton refresh : to manuel mercado
Posted: Sat Aug 09, 2008 02:04 PM

i SENT YOU A TEST

Best Regards, Saludos



Falconi Silvio

Continue the discussion