Ribbonbar - oBar:enable()

Ribbonbar - oBar:enable()

Postby Otto » Thu Nov 08, 2012 9:14 pm

oBar:disable() - oBar:enable()

Hello Antonio,
it seems that oBar:enable() does not work.
Would you be so kind to have a look at this.

Thanks in advance
Otto



Code: Select all  Expand view
// TESTING ROUNDSIZE


#include "FiveWin.ch"
#include "ribbon.ch"

//----------------------------------------------------------------------------//

function Main()

   local oGrupo, oBtn1, oRibbon, oWnd
   local oBtn2, oBtn3, oBtn4, oBtn5

   SetBalloon( .T. )

   DEFINE WINDOW oWnd FROM 1, 1 To 22, 75 ;
      TITLE "This is a MDI enviroment"
   
   DEFINE RIBBONBAR oRibbon PROMPTS "Start","Edition","Tools","Themes","Help" OF oWnd ;
          HEIGHT 200 TOPMARGIN 25
   
   ADD GROUP oGrupo RIBBON oRibbon TO OPTION 1 PROMPT "Only a Group to Test"
   
   @ 05,04 ADD BUTTON oBtn1 PROMPT "Round 2" ;
           GROUP oGrupo SIZE 142, 25 Right BORDER ROUND ROUNDSIZE 2

   @ 35,04 ADD BUTTON oBtn1 PROMPT "Round 4" ;
           GROUP oGrupo SIZE 142, 25 Right BORDER ROUND ROUNDSIZE 4

   @ 65,04 ADD BUTTON oBtn1 PROMPT "Round 6" ;
           GROUP oGrupo SIZE 142, 25 Right BORDER ROUND ROUNDSIZE 6

   @ 95,04 ADD BUTTON oBtn1 PROMPT "Round 8" ;
           GROUP oGrupo SIZE 142, 25 Right BORDER ROUND ROUNDSIZE 8

   @ 125,04 ADD BUTTON oBtn1 PROMPT "Round 10" ;
           GROUP oGrupo SIZE 142, 25 Right BORDER ROUND ROUNDSIZE 10


   
    @ 300,30 ;
      BUTTON oBtn5 ;
      PROMPT "disable" ;
        SIZE 60, 20 ;
      ACTION oRibbon:disable() ;
          OF oWnd ;
       PIXEL

    @ 300,130 ;
      BUTTON oBtn5 ;
      PROMPT "enable" ;
        SIZE 60, 20 ;
      ACTION oRibbon:enable() ;
          OF oWnd ;
       PIXEL
   
   
   
   SET MESSAGE OF oWnd TO "A message bar"

      ACTIVATE WINDOW oWnd ;
         MAXIMIZED


return nil
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: Ribbonbar - oBar:enable()

Postby Otto » Thu Nov 08, 2012 10:10 pm

Hello Antonio,
I don't know if this is the right ( Super:Enable( ) )
way to fix the problem but it is working.
Best regards,
Otto
Code: Select all  Expand view

METHOD Enable( nPos, lOnOff ) CLASS TRibbonBar
   local lOldStatus

   DEFAULT nPos := ::nOption

   if nPos > Len( ::aDialogs ) .or. nPos < 1
      return NIL
   endif

   if lOnOff != NIL
      lOldStatus := ::aEnable[ nPos ]
      ::aEnable[ nPos ] := lOnOff
      ::Default()
      ::Refresh()
   endif
    
    Super:Enable( )

return ::aEnable[ nPos ]
 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: Ribbonbar - oBar:enable()

Postby Francisco Horta » Fri Nov 09, 2012 7:08 pm

Otto,
you're right !!,
i tested obar:enable() and obar:disable() and not work..
i used this:
oRibbon:Hide(no.group) y oRibbon:Show(no.group)
before oRibbon:CalcPos()
regards
paco
____________________
Paco
Francisco Horta
 
Posts: 845
Joined: Sun Oct 09, 2005 5:36 pm
Location: la laguna, mexico.

Re: Ribbonbar - oBar:enable()

Postby Antonio Linares » Fri Nov 09, 2012 7:54 pm

Otto,

Implemented as suggested, many thanks! :-)
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 46 guests