New feature to Ribbon, QuickAccess Area

New feature to Ribbon, QuickAccess Area

Postby Daniel Garcia-Gil » Tue Jun 22, 2010 2:35 am

New feature Quick Access and Quick Button

Sample:
http://www.sitasoft.net/fivewin/samples/testqck.rar

Code: Select all  Expand view
#include "Fivewin.ch"
#include "Ribbon.ch"
 
Function Main()

   local oWnd, oRibbon
   local oGrupo, oBtn1, oBtn2, oQbtn1, oQbtn2, oQbtn3
   local oQck, oBtn
 
   SetBalloon( .T. )

   Define window ownd Title "Fivewin RibbonBar"

   DEFINE RIBBONBAR oRibbon PROMPTS "Start","Edition","Tools","Themes","Help" OF oWnd ;
          HEIGHT 180 TOPMARGIN 60
   
   ADD GROUP oGrupo RIBBON oRibbon TO OPTION 1 PROMPT "Only a Group to Test"
   
   @ 04,04 ADD BUTTON oBtn1 PROMPT "Testing 1" BITMAP "..\bitmaps\paste32.bmp";
           GROUP oGrupo SIZE 142,40 LEFT ;
           Action( oBtn := oRibbon:oQuickAcc:AddButton("..\bitmaps\16x16\calc.bmp",{|| MsgInfo("1")} ),;
                   oBtn:bRClicked := {| nRow, nCol, nFlags, oBtn | MenuQuickDelete( oBtn, oQck ) } )
           
   @ 45,04 ADD BUTTON oBtn2 PROMPT "Testing 2" BITMAP "..\bitmaps\stylechange32.bmp";
           GROUP oGrupo SIZE 142,40 LEFT;
           Action oRibbon:oQuickAcc:DelButton( ATail( oRibbon:oQuickAcc:aButtons ) )
   
   DEFINE QUICKBUTTON OF oRibbon ;
          BITMAP  "..\Bitmaps\16x16\fivetech.bmp", "..\Bitmaps\btnqcka.bmp", "..\Bitmaps\btnqckb.bmp", "..\Bitmaps\btnqckc.bmp" ;
          ACTION AbreMenu( oWnd )
         
   DEFINE QUICKACCESS oQck OF oRibbon
   
   ADD BUTTON oQbtn1 QUICKACCESS oQck BITMAP "..\bitmaps\16x16\floppy.bmp"  ;
       ACTION MsgInfo("1")
       
   ADD BUTTON oQbtn2 QUICKACCESS oQck BITMAP "..\bitmaps\16x16\closeall.bmp"  ;
       ACTION MsgInfo("2")
       
   ADD BUTTON oQbtn3 QUICKACCESS oQck BITMAP "..\bitmaps\16x16\additem.bmp" ;
       ACTION MsgInfo("3")

   ADD BUTTON oQbtn3 QUICKACCESS oQck BITMAP "..\bitmaps\16x16\adddbf.bmp" ;
       ACTION MsgInfo("4")
   
   
   oBtn1:bRClicked := {| nRow, nCol, nFlags, oBtn | MenuQuickAdd( oBtn, oQck, "..\bitmaps\16x16\paste.bmp" ) }
   oBtn2:bRClicked := {| nRow, nCol, nFlags, oBtn | MenuQuickAdd( oBtn, oQck, , .T.) }
   
   AEval( oQck:aButtons, {|o| o:bRClicked := {| nRow, nCol, nFlags, oBtn | MenuQuickDelete( oBtn, oQck ) } } )
       
   
   oRibbon:nSeparation( 5 )
   
   SET MESSAGE OF oWnd TO "Sample Quick Button + Quick Access" CENTERED CLOCK KEYBOARD 2007
   Activate window ownd

Return Nil  


Function AbreMenu( oWindow )

 Local oMenu
 MENU oMenu POPUP 2007
    MENUITEM "Open"
    MENU
       MENUITEM "New"
       SEPARATOR
       MENUITEM "Other"
    ENDMENU
    MENUITEM "Save As..."
    MENU
       MENUITEM "DBF..."
       SEPARATOR
       MENUITEM "XML..."
    ENDMENU
    SEPARATOR
    MENUITEM "Close App..." Action oWindow:End()
 ENDMENU
 
ACTIVATE POPUP oMenu AT 48, 2 OF oWindow

return NIL

FUNCTION MenuQuickDelete( oBtn, oQuickAcc )
   Local oMenu
   
   MENU oMenu POPUP 2007
      MENUITEM "Remove QuickAccess" Action oQuickAcc:DelButton( oBtn )
   ENDMENU
   
   ACTIVATE POPUP oMenu AT oBtn:nHeight, oBtn:nLeft OF oQuickAcc:oRibbon
   
Return Nil

FUNCTION MenuQuickAdd( oBtn, oQuickAcc, cName, lAdjust )
   Local oMenu, o
   
   DEFAULT cName := oBtn:cName
   DEFAULT lAdjust := .F.
   
   MENU oMenu POPUP 2007
      MENUITEM "Add to QuickAccess" ;
                ACTION ( oBtn:Cargo := oQuickAcc:AddButton( cName, oBtn:bAction, , lAdjust ),;
                         oBtn:Cargo:bRClicked := {| nRow, nCol, nFlags, oBtn | MenuQuickDelete( oBtn, oQuickAcc ) } );
                WHEN ( If( oBtn:Cargo == NIL, .T.,;
                           AScan( oQuickAcc:aButtons, {| oB | oB:hWnd == oBtn:Cargo:hWnd } ) == 0 ) )
           
   ENDMENU
   
   ACTIVATE POPUP oMenu AT oBtn:nHeight() + oBtn:nTop, oBtn:nLeft OF oBtn:oWnd
   
Return Nil


 



Image



Thanks to lailton by collaborate to build this feature, shared code and time
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: New feature to Ribbon, QuickAccess Area

Postby RAMESHBABU » Tue Jun 22, 2010 2:59 am

Mr.Antonio/Mr.Daniel,

Congratualation. Excellent Addition to Ribbonbar Class.

- Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Re: New feature to Ribbon, QuickAccess Area

Postby gkuhnert » Tue Jun 22, 2010 7:22 am

Wow, very cool. Is this nice feature to come in the June upgrade?
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Re: New feature to Ribbon, QuickAccess Area

Postby fraxzi » Tue Jun 22, 2010 2:02 pm

Dear Daniel,

Can I add an MDIChild window to ribbon quick access when child window is maximized and remove from quick access when restored/iconized?

If so, can you post a sample?


Regards,
Frances
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: New feature to Ribbon, QuickAccess Area

Postby TecniSoftware » Tue Jun 22, 2010 4:06 pm

Daniel:

Esta online la web?
He querido descargar el ejemplo desde esta mañana y no he podido.

Muchos saludos!
User avatar
TecniSoftware
 
Posts: 235
Joined: Fri Oct 28, 2005 6:29 pm
Location: Quilmes, Buenos Aires, Argentina

Re: New feature to Ribbon, QuickAccess Area

Postby Daniel Garcia-Gil » Tue Jun 22, 2010 4:12 pm

TecniSoftware wrote:Daniel:

Esta online la web?
He querido descargar el ejemplo desde esta mañana y no he podido.

Muchos saludos!


que error te genera ?

what error do you get?
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: New feature to Ribbon, QuickAccess Area

Postby TecniSoftware » Tue Jun 22, 2010 4:30 pm

Daniel:

Debe ser algun problema con mi isp por que le tire un ping y me dio los 4 paquetes perdidos, tiempo de espera agotado, sin embargo, hice un remote upload a rapidshare y ahi pudo cargarlo.
Por si alguien lo prefiere, quedo subido a: http://rapidshare.com/files/401713587/testqck.rar.html

Saludos y gracias.
Alejandro Cebolido
Buenos Aires, Argentina
User avatar
TecniSoftware
 
Posts: 235
Joined: Fri Oct 28, 2005 6:29 pm
Location: Quilmes, Buenos Aires, Argentina

Re: New feature to Ribbon, QuickAccess Area

Postby Daniel Garcia-Gil » Tue Jun 22, 2010 5:20 pm

Alejandro

Gracias por el feedback
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: New feature to Ribbon, QuickAccess Area

Postby Antonio Linares » Tue Jun 22, 2010 6:34 pm

Gilbert,

Yes, it will be included in FWH 10.6 June :-)
regards, saludos

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

Re: New feature to Ribbon, QuickAccess Area

Postby Daniel Garcia-Gil » Wed Jun 23, 2010 1:45 pm

fraxzi wrote:Dear Daniel,

Can I add an MDIChild window to ribbon quick access when child window is maximized and remove from quick access when restored/iconized?

If so, can you post a sample?



Frances

i hope this sample work how you expect

http://www.sitasoft.net/fivewin/samples/testqck2.zip
Image
Image
Code: Select all  Expand view

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

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

function Main()

   local oGrupo, oQck, oBtn1, oRibbon, oWnd

   SetBalloon( .T. )

   DEFINE WINDOW oWnd FROM 1, 1 To 22, 75 ;
      TITLE "This is a MDI enviroment" MDI VSCROLL
   
   DEFINE RIBBONBAR oRibbon PROMPTS "Start","Edition","Tools","Themes","Help" OF oWnd ;
          HEIGHT 150 TOPMARGIN 60
   
   ADD GROUP oGrupo RIBBON oRibbon TO OPTION 1 PROMPT "Only a Group to Test"
   
   @ 04,04 ADD BUTTON oBtn1 PROMPT "Add MdiChild" BITMAP "..\bitmaps\new3.bmp";
           GROUP oGrupo SIZE 142,40 LEFT ;
           ACTION CreateChild( oQck, oWnd )

   
   DEFINE QUICKBUTTON OF oRibbon ;
          BITMAP NIL, "..\Bitmaps\btnqcka.bmp", "..\Bitmaps\btnqckb.bmp", "..\Bitmaps\btnqckc.bmp" ;
          ACTION MsgInfo( "Informartion" )
         
   DEFINE QUICKACCESS oQck OF oRibbon
   

   SET MESSAGE OF oWnd TO "A message bar"

   ACTIVATE WINDOW oWnd

return nil

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

function CreateChild( oQck, oWnd )

   local oChild, oQbtn1
   
   oChild = oWnd:ChildNew()
   oChild:bResized = {| nType | AddToQuick( nType, oChild, oQck, oWnd ) }
   oChild:bPostEnd   = {|| DelToQuick( oQck, oChild, oWnd ) }

return nil

function AddToQuick( nType, oChild, oQck, oWnd )
   local oBtn1
   local oWndChild

   if oChild:Cargo == NIL
      if nType == 2
         for each oWndChild in oWnd:oWndClient:aWnd
            ADD BUTTON oWndChild:Cargo QUICKACCESS oQck BITMAP "..\bitmaps\16x16\form.bmp"  ;
                ACTION oWndChild:SetFocus()
            oWndChild:Cargo:cToolTip = oWndChild:cTitle
         next
      endif  
   else
      if nType == 1 .or. nType == 0
         if  AScan( oWnd:oWndClient:aWnd, {| oWndChild | IsZoomed( oWndChild:hWnd ) } ) == 0
            for each oWndChild in oWnd:oWndClient:aWnd
               oQck:DelButton( oWndChild:Cargo )
               oWndChild:Cargo = NIL
            next
         endif
      endif
   endif
return nil      

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

function DelToQuick( oQck, oChild, oWnd )
   local oWndChild

   if Len( oQck:aButtons )  > 0
      oQck:DelButton( oChild:Cargo )
      // we need change the action in each button
      for each oWndChild in oWnd:oWndClient:aWnd
         // one button by mdichild
         oQck:aButtons[ oWndChild:__EnumIndex ]:bAction = {| | oWndChild:SetFocus() }
      next
   endif
   
return .T.
     
//----------------------------------------------------------------------------//
 
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: New feature to Ribbon, QuickAccess Area

Postby MdaSolution » Wed Jun 23, 2010 3:04 pm

A question...
You perhaps U know exist 4 color skyn of the Ribbon ( Blue,Black,Orange and the new 2010 color)

I see it on office 2007

if we change the color of ribbon how we can change color the quickacess?

Have you think to implment skyn color function for It ?


have you sample test of backstage feature ?
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: New feature to Ribbon, QuickAccess Area

Postby Daniel Garcia-Gil » Wed Jun 23, 2010 4:24 pm

Mda

MdaSolution wrote:if we change the color of ribbon how we can change color the quickacess?

the ribbon color are customizables
Image

and you can control alpha channel level too

Image

MdaSolution wrote:Have you think to implment skyn color function for It ?

the programmer can build you own skin to set ribbon
we wan not limit to only 4 color skin

MdaSolution wrote:have you sample test of backstage feature ?

we're working in that
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: New feature to Ribbon, QuickAccess Area

Postby fraxzi » Thu Jun 24, 2010 6:25 am

Dear Daniel,

This is great! I can now eliminate the MDI Menu.. Better with quick access..


Regards,
Frances
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: New feature to Ribbon, QuickAccess Area

Postby fraxzi » Thu Jun 24, 2010 7:06 am

Dear Daniel,

When I maximized child window.. the MDI Menu appears..

I add this to remove MDI Menu on parent window

Code: Select all  Expand view

...
Menu oMenu 2007
EndMenu

DEFINE WINDOW oWnd FROM 1, 1 To 22, 75 ;
       TITLE "This is a MDI enviroment" MDI VSCROLL;
       MENU oMenu
....
 


sorry. Could this be a different matter. :)

Regards,
Frances
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: New feature to Ribbon, QuickAccess Area

Postby Daniel Garcia-Gil » Thu Jun 24, 2010 12:37 pm

fraxzi wrote:Could this be a different matter


i don't think so :D
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 17 guests