RibbonBar

Re: RibbonBar

Postby Antonio Linares » Tue Jun 04, 2013 4:02 pm

James,

James Bott wrote:Antonio,

Gee, Enrico and I just had a discussion about not setting objects to nil, but instead calling the End() method. Shouldn't that be done here too? I note that there are functions like Destroy() and DelItems() in the End() method that if not called might cause a memory leak.

James


Its a technical reason mainly. From an object oriented point of view, calling End() should be enough, but we need to force the garbage collector to work as that does the real inner cleaning, and it gets invoked assigning it to nil. We can not make Self := nil from within a method.

We could implement a Destructor method that automatically gets called and this would avoid the assignment, but as Harbour and xHarbour did not had them since the beginning and implementations were not identical on both, we did not used them in FWH. But now we could use it :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42093
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: RibbonBar

Postby Antonio Linares » Tue Jun 04, 2013 4:07 pm

Enrico Maria Giordano wrote:Fourth problem: there is a flicker on all the controls of the dialog when a ribbonbar tab is clicked. If a sample is needed I can create one.

Any ideas on how to alleviate the flickering?

EMG


Both Classes TRibbonBar and TRBpanel use double buffering, so there should be no flickerings,

Do you get the flickering using FWH/samples/rbdesign.prg too ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42093
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: RibbonBar

Postby Enrico Maria Giordano » Tue Jun 04, 2013 5:54 pm

Antonio,

Antonio Linares wrote:
Enrico Maria Giordano wrote:Fourth problem: there is a flicker on all the controls of the dialog when a ribbonbar tab is clicked. If a sample is needed I can create one.

Any ideas on how to alleviate the flickering?

EMG


Both Classes TRibbonBar and TRBpanel use double buffering, so there should be no flickerings,

Do you get the flickering using FWH/samples/rbdesign.prg too ?


Is rbdesing.prg only for Harbour? I get unresolved external using xHarbour... :-(

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

Re: RibbonBar

Postby Enrico Maria Giordano » Tue Jun 04, 2013 6:07 pm

This is a sample of the problem. Please click on the tabs and you will see the browse flickering.

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


FUNCTION MAIN()

    LOCAL oDlg

    USE CUSTOMER

    DEFINE DIALOG oDlg;
           SIZE 800, 600

    @ 4, 1 LISTBOX FIELDS SIZE 200, 200

    ACTIVATE DIALOG oDlg;
             ON INIT MAKERIBBON( oDlg );
             CENTER

    RETURN NIL


STATIC FUNCTION MAKERIBBON( oDlg )

    LOCAL oRib

    LOCAL oGr1, oGr2, oGr3, oGr4

    LOCAL oMn1

    MENU oMn1 POPUP
        MENUITEM "Test 1" ACTION MSGINFO( "Test 1" )
        MENUITEM "Test 2" ACTION MSGINFO( "Test 2" )
        MENUITEM "Test 3" ACTION MSGINFO( "Test 3" )
        MENUITEM "Test 4"
    ENDMENU

    DEFINE RIBBONBAR oRib OF oDlg;
           HEIGHT 100;
           PROMPT "Test 1", "Test 2", "Test 3"

    oRib:SetSize( oDlg:nWidth, 100 )

    ADD GROUP oGr1 RIBBONBAR oRib;
              WIDTH 80;
              TO OPTION 1;

    @ 4, 4 ADD BUTTON GROUP oGr1;
           SIZE oGr1:nWidth - 9, oGr1:nHeight - 7;
           PROMPT "Test 1";
           BITMAP "OPEN.BMP";
           ACTION MSGINFO( "Test 1" )

    ADD GROUP oGr2 RIBBONBAR oRib;
              WIDTH 80;
              TO OPTION 1;

    @ 4, 4 ADD BUTTON GROUP oGr2;
           SIZE oGr2:nWidth - 9, oGr2:nHeight - 7;
           PROMPT "Test 2";
           BITMAP "OPEN.BMP";
           ACTION MSGINFO( "Test 2" );
           POPUP MENU oMn1

    ADD GROUP oGr3 RIBBONBAR oRib;
              WIDTH 80;
              TO OPTION 2;

    @ 4, 4 ADD BUTTON GROUP oGr3;
           SIZE oGr3:nWidth - 9, oGr3:nHeight - 7;
           PROMPT "Test 3";
           BITMAP "OPEN.BMP";
           ACTION MSGINFO( "Test 3" )

    ADD GROUP oGr4 RIBBONBAR oRib;
              WIDTH 80;
              TO OPTION 2;

    @ 4, 4 ADD BUTTON GROUP oGr4;
           SIZE oGr4:nWidth - 9, oGr4:nHeight - 7;
           PROMPT "Test 4";
           BITMAP "OPEN.BMP";
           ACTION MSGINFO( "Test 4" );
           POPUP MENU oMn1

    RETURN NIL


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

Re: RibbonBar

Postby Enrico Maria Giordano » Tue Jun 04, 2013 7:54 pm

Fifth problem: oRib:aEvalWhen() doesn't update enable/disable status of the buttons. I noticed the function RefreshRibbonBarBtn(). Can't it be called inside an overriden oRib:aEvalWhen() method?

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

Re: RibbonBar

Postby Antonio Linares » Tue Jun 04, 2013 8:38 pm

Enrico,

Yes, very good idea, thanks! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42093
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: RibbonBar

Postby Antonio Linares » Tue Jun 04, 2013 8:58 pm

Enrico,

For the flick error, please change these methods in Class TRibbonBar:

Code: Select all  Expand view
METHOD SetOption( nOption ) CLASS TRibbonBar

   local nAt

   ::nOldOption = ::nOption
   nOption = ::ScanOption( nOption )

   if ::oBackStage != nil .and. IsWindowVisible( ::oBackStage:hWnd )
      if nOption != ::nOption
         ::BackStage()
      endif
   endif

   if nOption != ::nOption .and. nOption != ::nOption .and. ::aEnable[ nOption ]
      ::nOption = nOption
      ::aDialogs[ ::nOldOption ]:Hide()
      ::PaintOver( ::nOption, 1 )
      ::Resize( 0, ::nWidth, ::nHeight  )
      ::aDialogs[ ::nOption ]:Show()
      if ! Empty( ::aDialogs[ ::nOption ]:aControls )
         AEval( ::aDialogs[ ::nOption ]:aControls, {| oControl | oControl:Show(), oControl:Refresh() } )
      endif
      ::aDialogs[ ::nOption ]:SetFocus()
      if ! Empty( ::bAction )
         Eval( ::bAction, nOption, ::nOldOption )
      endif
   endif

return ::nOldOption


and in METHOD ReSize( nType, nWidth, nHeight ) CLASS TRibbonBar remove this line:

// ::oWnd:ReSize( nType, nWidth, nHeight )

thanks :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42093
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: RibbonBar

Postby Enrico Maria Giordano » Tue Jun 04, 2013 9:10 pm

Antonio,

Antonio Linares wrote:Enrico,

For the flick error, please change these methods in Class TRibbonBar:


Unfortunately there is one more problem: after your fix, the tabs remains of a clear color after the click on them. :-(

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

Re: RibbonBar

Postby Enrico Maria Giordano » Tue Jun 04, 2013 9:12 pm

Antonio,

Antonio Linares wrote:Enrico,

It seems that problem 3 gets fixed with this line to include at line 836 in Class TRbtn:

Code: Select all  Expand view
                       if oWnd:oPopup == nil
                           oWnd:oPopup = ::oPopup
                           ::oPopup:Activate( ::nTop + ::nHeight(),;
                                              ::nLeft - If( ! oWnd:IsKindOf( "TRBGROUP" ), oWnd:nLeft, 0 ), oWnd, .F. )
                           oWnd:oPopup = nil  // new !!!                                          
                        endif  


An identical fix should be put in ShowPopup() method. :-)

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

Re: RibbonBar

Postby Antonio Linares » Wed Jun 05, 2013 1:53 pm

Enrico,

Enrico Maria Giordano wrote:Antonio,

Antonio Linares wrote:Enrico,

For the flick error, please change these methods in Class TRibbonBar:


Unfortunately there is one more problem: after your fix, the tabs remains of a clear color after the click on them. :-(

EMG


Fixed. Several changes are required, here they are. We include these changes in FWH 13.05 to be published today :-)

Image
Image
Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42093
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: RibbonBar

Postby Antonio Linares » Wed Jun 05, 2013 1:57 pm

Enrico Maria Giordano wrote:Antonio,

Antonio Linares wrote:Enrico,

It seems that problem 3 gets fixed with this line to include at line 836 in Class TRbtn:

Code: Select all  Expand view
                       if oWnd:oPopup == nil
                           oWnd:oPopup = ::oPopup
                           ::oPopup:Activate( ::nTop + ::nHeight(),;
                                              ::nLeft - If( ! oWnd:IsKindOf( "TRBGROUP" ), oWnd:nLeft, 0 ), oWnd, .F. )
                           oWnd:oPopup = nil  // new !!!                                          
                        endif  


An identical fix should be put in ShowPopup() method. :-)

EMG


Added and another more for another oPopup:Activate() that there is in the class. Thanks! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42093
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: RibbonBar

Postby Enrico Maria Giordano » Wed Jun 05, 2013 2:12 pm

Thank you, Antonio! :-)

By the way, I wonder if anyone of us have never used the ribbonbar... :?:

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

Re: RibbonBar

Postby Antonio Linares » Wed Jun 05, 2013 3:12 pm

Enrico,

I used it to develop rbdesign.prg :-) but did not tested it as intensively as you have done it :-)

many thanks!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42093
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: RibbonBar

Postby Massimo Linossi » Wed Jun 05, 2013 3:17 pm

Yes Enrico, but not the last one.
When I've tested it, I saw that is not working in a perfect way.
When you click on a button that has a popup menu, you can close the menu only clicking on another button.
The correct way, as in the last versions of Office, even on a Mac, is click the button and for closing click again on it.
And the little arrow, when there is the popup menu, is not correctly visible on a Terminal Server session.
How is working now ?
Thanks a lot.
Massimo
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: RibbonBar

Postby Silvio.Falconi » Wed Jun 05, 2013 5:27 pm

Enrico,
I'm thinking and I saw the oldest releases of Daniel not supported the ribbonbar on a Dialog but only on Window.
Perhaps with Dialog there was problems, I don't Know why
Then on the last release I not founded the control command on the new method of ribbonbar
where blocked it the oWnd:Iskindof was a Dialog but I am sure there was .
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: karinha, nageswaragunupudi and 103 guests