Page 1 of 1

URGENT - RIBBONBAR ERROR - RESOLVED!!

Posted: Sun Apr 05, 2020 10:23 pm
by Silvio.Falconi
if I make the window smaller and then reopen the ribbonbar controls disappear see the gif recordered





How is it possible ?

Ribbonbar is not reliable - how I solve?

this a test sample to recreate the problem

Code: Select all

#include "fivewin.ch"
#include "constant.ch"
#include "ribbon.ch"



function main()

   local oRebar
   local oWnd,oGrS1,oGrS2
   local oFontBigNum
   local dDataIniziale:= date()
   local dDataFinale:= date()
   local oDate1
   local oDate2
   local dBassa1
   local dBassa4
   local lShowNumeri:= .t.
   local lshowPagamenti:= .t.
   local oBtns[1]

   DEFINE FONT  oFontBigNum NAME "VERDANA" SIZE 30,-40

   DEFINE WINDOW oWnd TITLE "RibbonBar Test " + FWVERSION from 1,1 to 600,600 pixel //brush oBrush1
   
   DEFINE RIBBONBAR oRebar WINDOW oWnd PROMPT "test numbers" HEIGHT 133 TOPMARGIN 25
   

    ADD GROUP oGrS1 RIBBON oRebar TO OPTION 1  WIDTH 625 PROMPT "Periodo da visualizzare"
    ADD GROUP oGrS2 RIBBON oRebar TO OPTION 1  WIDTH 160 PROMPT "Prenotazione singola"

     
 @ 5,5 ADD BUTTON oBtns[1] prompt "Selezione"+CRLF+"Calendario" BITMAP "TOOLBAR_CALENDAR" ;
      GROUP oGrS1 SIZE 65,85 top ROUND SPLITPOPUP;
      MENU  MenuPopDate2(@dDataIniziale,@dDataFinale,@oDate1,@oDate2,dBassa1,dBassa4,lShowNumeri,lshowPagamenti) ;
      TOOLTIP "Selezione calendario e periodi "




 @ 12,110 GET oDate1 VAR dDataIniziale SIZE 200,30 PIXEL  OF  oGrS1 ;
   on change NIL 
 @ 12,335  GET oDate2 VAR dDataFinale SIZE 200,30 PIXEL  OF  oGrS1 ;
   on change NIL

   oRebar:nLeftMargin = 75
   oRebar:CalcPos()

  oWnd:Center()

  ACTIVATE WINDOW oWnd MAXIMIZED


   oRebar:End()

return nil
//--------------------------------------------------------------------------------------------------------//

static Function  MenuPopDate2(dDataIniziale,dDataFinale,oDate1,oDate2,dBassa1,dBassa4)
   Local oPopupDate


   MENU oPopupDate POPUP
     MENUITEM "Oggi"  ACTION ( dDataIniziale  :=date(),;
                               dDataFinale    :=date(),;
                               oDate1:refresh(),oDate2:refresh(),;
                               EVAL( oDate1:bchange),;
                               EVAL( oDate2:bchange))

     MENUITEM "Domani"  ACTION ( dDataIniziale  :=date()+1,;
                                 dDataFinale    :=date()+1,;
                                 oDate1:refresh(),oDate2:refresh(),;
                                 EVAL( oDate1:bchange),;
                                 EVAL( oDate2:bchange))

     MENUITEM "DopoDomani"  ACTION (dDataIniziale  :=date()+2,;
                                    dDataFinale    :=date()+2,;
                                    oDate1:refresh(),oDate2:refresh(),;
                                    EVAL( oDate1:bchange),;
                                    EVAL( oDate2:bchange))
      SEPARATOR

     MENUITEM "Mese Corrente"  ACTION (dDataIniziale:=bom(date()),;
                                        dDataFinale:= eom(date()),;
                                       oDate1:refresh(),oDate2:refresh(),;
                                       EVAL( oDate1:bchange),;
                                       EVAL( oDate2:bchange))

     MENUITEM "Mese Prossimo"  ACTION (dDataIniziale:=AddMonth(bom(date()),1),;
                                       dDataFinale:= AddMonth(eom(date()),1),;
                                       oDate1:refresh(),oDate2:refresh(),;
                                       EVAL( oDate1:bchange),;
                                       EVAL( oDate2:bchange))

     MENUITEM "Stagione"  ACTION (dDataIniziale:= (dBassa1),;
                                    dDataFinale:= ( dBassa4)  ,;
                                    oDate1:refresh(),oDate2:refresh(),;
                                    EVAL( oDate1:bchange),;
                                    EVAL( oDate2:bchange))


     SEPARATOR


     MENUITEM "Giugno"  ACTION (dDataIniziale:=AddMonth( BOY( DATE() ), 5 ),;
                                dDataFinale:=EoM(AddMonth( BOY( DATE() ), 5 )),;
                                oDate1:refresh(),oDate2:refresh(),;
                                EVAL( oDate1:bchange),;
                                EVAL( oDate2:bchange))

     MENUITEM "Luglio"  ACTION (dDataIniziale:=AddMonth( BOY( DATE() ), 6 ),;
                                dDataFinale:=EoM(AddMonth( BOY( DATE() ), 6 )),;
                                oDate1:refresh(),oDate2:refresh(),;
                                EVAL( oDate1:bchange),;
                                EVAL( oDate2:bchange))

     MENUITEM "Agosto"  ACTION (dDataIniziale:=AddMonth( BOY( DATE() ), 7 ),;
                                dDataFinale:=EoM(AddMonth( BOY( DATE() ), 7 )),;
                                oDate1:refresh(),oDate2:refresh(),;
                                EVAL( oDate1:bchange),;
                                EVAL( oDate2:bchange))


       MENUITEM "Settembre"  ACTION (dDataIniziale:=AddMonth( BOY( DATE() ), 8 ),;
                                     dDataFinale:=EoM(AddMonth( BOY( DATE() ), 8 )),;
                                     oDate1:refresh(),oDate2:refresh(),;
                                     EVAL( oDate1:bchange),;
                                     EVAL( oDate2:bchange))


 
 ENDMENU

 return oPopupDat

Re: URGENT - RIBBONBAR ERROR

Posted: Mon Apr 06, 2020 10:30 am
by MOISES

Re: URGENT - RIBBONBAR ERROR

Posted: Mon Apr 06, 2020 11:01 am
by Silvio.Falconi
MOISES wrote:Yes, already noticed in:

http://forums.fivetechsupport.com/viewt ... =6&t=38730

but it's not the same: I'm not talking to you about reducing the buttons


A lot more happens in my application

when I press the popup menu which is inside a button and reduce the window, everything in the tGroup disappears (oGrs1)

if I move the whole window appears under the tgroup (outside the program itself) and then disappears if one clicks on it with The mouse

Image

try the test I published and reduce the window, click on the first button (where you found a menupopup) then resize the window and you will find the tgroup under the main window

Re: URGENT - RIBBONBAR ERROR

Posted: Tue Apr 07, 2020 9:20 am
by Silvio.Falconi
there is a error on PopupGroup() method of CLASS TRBGroup


I did a test
I remmed everything that is written in the CLASS TRBGroup PopupGroup () method.

I made the window smaller

if I click on the button the menu is not displayed

then I widened the window and everything is as before

so the error is on this method when it goes to create the popup window

for the mine application for now I resolve in this mode

Re: URGENT - RIBBONBAR ERROR

Posted: Tue Apr 07, 2020 10:04 am
by Antonio Linares
Dear Silvio,

Your example is working fine here

Could you created an animated GIF to show how to reproduce the error or explain it ?

many thanks

Re: URGENT - RIBBONBAR ERROR

Posted: Tue Apr 07, 2020 10:58 am
by Silvio.Falconi
it's easy
when you have the main window shrunk, in the group of the ribbonbar show an arrow if you click on that arrow it shows you what is in the group in popup mode
leaving the popup window open and widening the window afterwards you will not see the controls in the group of the ribbonbar
if you move the whole window with the mouse you will see that the popup is below

please see this
https://we.tl/t-hXtWhZg9Yi

Re: URGENT - RIBBONBAR ERROR

Posted: Tue Apr 07, 2020 2:46 pm
by Antonio Linares
Fixed, many thanks

Image

Re: URGENT - RIBBONBAR ERROR

Posted: Tue Apr 07, 2020 2:55 pm
by Silvio.Falconi
thanks run ok