FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour RIBBON NATIVA AVANCES
Posts: 77
Joined: Sun Aug 26, 2007 11:53 PM
RIBBON NATIVA AVANCES
Posted: Thu Nov 19, 2009 01:06 AM
I refer to the topic in the Spanish forum

http://forums.fivetechsupport.com/viewtopic.php?f=6&t=17037

Antonio says

The design of the RibbonBar of Microsoft has changed since Office 2007 and that model has been implemented in Windows 7.

We are not supporters of drawing on the title bar. Maybe we can place those buttons on the tabs of RibbonBar.

And Windows 7 has eliminated the "round" used in Office 2007, and has become a tab in the Tab, blue.

So now we should decide between all that is our preferred choice model


Yes I am in favour of leaving the strange round button off the title bar but.
Please put the buttons on the title bar so we can include common commands such as undo/redo/file/print etc.

How far away are these changes?
I want to upgrade my FW now exchange rate is ok.

Jonathan
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: RIBBON NATIVA AVANCES
Posted: Thu Nov 19, 2009 02:02 AM
Jonathan,

Using FWH current RibbonBar and Class TRBtn, we can already do it very easily, See how nice it looks :-)



Code (fw): Select all Collapse
聽...
聽 聽DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "Configuraci贸n", "Ficheros", "Informes", "Ayudas" HEIGHT 160 TOPMARGIN 55

聽 聽oTBtn1 = TRBtn():New( 10, 10,,, "..\bitmaps\16x16\new2.bmp", {|| MsgInfo( "new" ) }, oRBar ) 

聽 聽oTBtn2 = TRBtn():New( 10, 35,,, "..\bitmaps\16x16\open2.bmp", {|| MsgInfo( "open" ) }, oRBar ) 

聽 聽oTBtn3 = TRBtn():New( 10, 60,,, "..\bitmaps\16x16\exit2.bmp", {|| MsgInfo( "exit" ) }, oRBar ) 

聽 聽ADD GROUP oGr RIBBON oRBar TO OPTION 1 PROMPT "Clipboard" width 130 //BITMAP "c:\fwh\bitmap\fivetech.BMP"
聽...
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: RIBBON NATIVA AVANCES
Posted: Thu Nov 19, 2009 06:52 AM
Antonio, thank you.
Best regards,
Otto

Posts: 77
Joined: Sun Aug 26, 2007 11:53 PM
Re: RIBBON NATIVA AVANCES
Posted: Thu Nov 19, 2009 09:17 PM
Yes very nice.



1) Can ribbon bar have a first tab drop down menu to replace the 'round' that was in Office 2007?

2) Can TRBtn buttons be placed on the title bar?

Thanks
Jonathan
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: RIBBON NATIVA AVANCES
Posted: Fri Nov 20, 2009 08:24 AM

Antonio,
CAn we insert a big Round button at init ( at left ) as default a gray circle bitmaps where insert the bitmap of our application and the a small oBar where we can inser oTbtn1,oTbtn2,oTbtn3 ?

I thinked also ... we have the possibility to customize this ribbon with another colors : BLUE ( now we use this) , BLACK, SILVER, AQUA ?

CAN we use Normal font or large fonts ?

Can we move all RIGHT TO LEFT ?

can we show quick access toolbar ?

can we show the Horizontal menu ?

Best Regards, Saludos



Falconi Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: RIBBON NATIVA AVANCES
Posted: Fri Nov 20, 2009 08:41 AM
this is my idea :
create a new method where create a small buttonbar where insert mini buttons
I try to create this but I not Know how create rge roundbox smaller at the left angle of the ribbon

METHOD PaintQuickAccess() CLASS TRibbonBar
local nTop, nBottom
local aRect := GetClientRect( ::hWnd )
local hDCMem, hBmpMem, hBmpBrush, hOldBmpBrush
local hOldBmp
local hBrush, hBrush2
local n, nType

local aInfo

aInfo := ::DispBegin()

default nType := 4


hDCMem = CreateCompatibleDC( ::hDC )

hBmpMem = CreateCompatibleBitmap( ::hDC, aRect[ 4 ], aRect[ 3 ] )

hOldBmp = SelectObject( hDCMem, hBmpMem )


hBrush2 = CreateSolidBrush( ::nClrPaneRB )
FillRect( hDCMem, aRect, hBrush2 )

nTop = aRect[ 1 ] + 5

RoundBox( hDCMem, 1, nTop-10, aRect[ 4 ]+1, aRect[ 3 ], 5, 7, ::nClrBoxOut )
RoundBox( hDCMem, 2, nTop , aRect[ 4 ], aRect[ 3 ], 5, 7, ::nClrBoxIn )



BitBlt( ::hDC, 0, 0, aRect[4], aRect[3], hDCMem, 0, 0, SRCCOPY )


SelectObject( hDCMem, hOldBmp )

DeleteObject( hBrush )
DeleteObject( hBrush2 )
DeleteObject( hBmpMem )

DeleteDC( hDCMem )

::DispEnd( aInfo )

return NIL



Create this we can use on TribbonBAr a oQuick Data where we can insert buttons
Best Regards, Saludos



Falconi Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: RIBBON NATIVA AVANCES
Posted: Fri Nov 20, 2009 09:12 AM
OR THIS A SOLUTION




Code (fw): Select all Collapse
function main()

   local oRBar
   local oWnd, oMenu
   local oGr, oGr1, oGr2, oGr3, oGr4
   local oBtn,   oBtn1,  oBtn2,  oBtn3,  oBtn4, oBtn5
   local oBtn6,  oBtn7,  oBtn8,  oBtn9,  oBtn10
   local oBtn11, oBtn12, oBtn13, oBtn14, oBtn15
   local oBtn16, oBtn17, oBtn18, oBtn19, oBtn20
   local oBtn21, oBtn22, oBtn23, oBtn24, oBtn25
   local oBtn26, oBtn27, oBtn28, oBtn29, oBtn30
   local oBtn31, oBtn32, oBtn33, oBtn34, oBtn35

   Local oQuickAccessBar
   Local  oTBtn0,oTBtn1,oTBtn2,oTBtn3

   menu oMenu Popup 2007

      menuitem "Style Set" FILE "..\bitmaps\styleset161.BMP"
      menuitem "Colors"
      menuitem "Font"

   endmenu

   DEFINE WINDOW oWnd TITLE "RibbonBar Test " + FWVERSION from 1,1 to 600,600 pixel //brush oBrush1



   DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "Configuraci贸n", "Ficheros", "Informes", "Ayudas" HEIGHT 160 TOPMARGIN 55

// to create round button big at the init 

   oTBtn0 = TRBtn():New( 5, 5,50,50, "..\bitmaps\btnstr0.bmp", {|| MsgInfo( "new" ) }, oRBar )



   // to create a small Quick Access toolbar

   oQuickAccessBar:= TRBGroup():New(oRBar, 6, 60,;
                                                          25, oRBar:nRight , ;
                                                          2, , , , ,,;
                                                           oRBar:hBrushEx, , , , oRBar, )


   // to insert button on QuikAccess Toolbar

   oTBtn1 = TRBtn():New( 5, 5,,, "..\bitmaps\16x16\new2.bmp", {|| MsgInfo( "new" ) }, oQuickAccessBar )

   oTBtn2 = TRBtn():New( 5, 35,,, "..\bitmaps\16x16\open2.bmp", {|| MsgInfo( "open" ) }, oQuickAccessBar )

   oTBtn3 = TRBtn():New( 5, 60,,, "..\bitmaps\16x16\exit2.bmp", {|| MsgInfo( "exit" ) }, oQuickAccessBar )
Best Regards, Saludos



Falconi Silvio
Posts: 77
Joined: Sun Aug 26, 2007 11:53 PM
Re: RIBBON NATIVA AVANCES
Posted: Sat Nov 21, 2009 04:07 AM
Silvio - In Windows 7 M$ applications the big round button has been superceeded by the menu tab at
the start of the ribbon bar. To keep up to date do u realy want a round button now.


Antonio -

1) Are there plans to have a first tab drop down menu on the ribbon bar to replace the 'round' that was in 2007?

2) Are there plans to be able to place TRBtn buttons on the title bar?

Thanks
Jonathan
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: RIBBON NATIVA AVANCES
Posted: Sat Nov 21, 2009 08:00 AM
Hello Jonathan,
have you tried:


Code (fw): Select all Collapse
 聽
oTBtn3 = TRBtn():New( 1, 5,40,, ".\bitmaps\16x16\exit2.bmp", {|| ownd:end() }, oRBar ,;
聽 聽 , , , ,;
聽 聽 聽 聽 聽 聽 聽 聽, , , , , , ;
聽 聽 聽 聽 聽 聽 聽 聽, , , "POPUP") 
聽 
聽//oTBtn3:cTypeButton := "POPUP"
聽/*
聽METHOD New( nTop, nLeft, nWidth, nHeight, cName, ;
聽 聽 聽 聽 聽 聽 聽 聽bAction, oWnd, cMsg, bWhen, lAdjust, lUpdate,;
聽 聽 聽 聽 聽 聽 聽 聽cPrompt, oFont, lBorder, lRound, cLayout, hBack, ;
聽 聽 聽 聽 聽 聽 聽 聽cToolTip, nTopEx, nLeftEx, cTypeButton,oPopup,;
聽 聽 聽 聽 聽 聽 聽 聽bClrGradNormal, aClrGradOver, bClrGradSubOver, ;
聽 聽 聽 聽 聽 聽 聽 聽aClrGradUnder, aClrGradBack, bClrGradSelect, bClrGradSelectPress, aClrGradBtnGr,;
聽 聽 聽 聽 聽 聽 聽 聽lGrouping, lFirstElm, lEndElm, lTrans, aGradiant, nClrBoxIn, nClrBoxOut )
聽
聽 */


Best regards,
Otto
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: RIBBON NATIVA AVANCES
Posted: Sat Nov 21, 2009 08:03 AM

Jonathan,

1) We can implement it quite easily, but that would force everyone to use the Windows 7 look.

2) We can paint on the title bar using Method NcPaint(), but we prefer not to paint there. Better leave Windows to use that area itself, or we could break the transparencies, etc. used in Windows 7.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: RIBBON NATIVA AVANCES
Posted: Sat Nov 21, 2009 08:04 AM

Otto,

Very interesting suggestion, thanks! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: RIBBON NATIVA AVANCES
Posted: Sat Nov 21, 2009 08:07 AM


Code (fw): Select all Collapse
 menu oMenu Popup 2007
   
      menuitem "Style Set" FILE "..\bitmaps\styleset161.BMP"
      menuitem "Colors"
      menuitem "Font"
      
   endmenu
   
   ***************************

 oTBtn3 = TRBtn():New( 1, 5,40,, ".\bitmaps\16x16\exit2.bmp", {|| ownd:end() }, oRBar ,;
    , , , ,;
               , , , , , , ;
               , , , "POPUP",oMenu)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: RIBBON NATIVA AVANCES
Posted: Sun Nov 22, 2009 12:11 PM
Otto,

Taking your idea one step further, so we can have Windows 7 look without forcing it in the Class :-)





Code (fw): Select all Collapse
聽 聽...
聽 聽local oTBtn0, oTBtn1, oTBtn2, oTBtn3
聽 聽local aClrMenu1 := { { 0.5, RGB( 69, 124, 188 ), RGB( 41, 93, 171 ) }, ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽{ 0.5, RGB( 26, 64, 136 ), RGB( 56, 135, 191 ) } }
聽 聽local aClrMenu2 := { { 0.5, RGB( 123, 178, 236 ), RGB( 71, 126, 205 ) }, ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽{ 0.5, RGB( 17, 78, 175 ), RGB( 128, 225, 255 ) } }
聽 聽...
聽 聽DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "Configuraci贸n", "Ficheros", "Informes", "Ayudas" HEIGHT 160 TOPMARGIN 55
聽 聽
聽 聽oRBar:nLeftMargin = 75
聽 聽oRBar:CalcPos()

聽 聽oTBtn0 = TRBtn():New( 34, 0, 70, 20, "..\bitmaps\rbnmenu.bmp", { || MsgInfo( "action" ) }, oRBar ,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽,,,,,, .T., .T.,,,,,, "POPUP", oMenu,,,,,,,,,,,,, aClrMenu1, nRGB( 125, 172, 215 ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽nRGB( 65, 106, 189 ) ) 
聽 聽oTBtn0:aClrGradOver = { || aClrMenu2 }
聽 聽oTBtn0:bClrGradSubOver = { || aClrMenu2 }
聽 聽...

This is looking better and better :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: RIBBON NATIVA AVANCES
Posted: Sun Nov 22, 2009 12:31 PM
Now, moving the top bitmaps to the right side and reducing the top margin to make it lool more Windows 7 alike:



FWH RibbonBar is really flexible and powerfull! :-)

Code (fw): Select all Collapse
   DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "Configuraci贸n", "Ficheros", "Informes", "Ayudas" HEIGHT 133 TOPMARGIN 25
   
   oRBar:nLeftMargin = 75
   oRBar:CalcPos()

   oTBtn0 = TRBtn():New( 4, 0, 70, 20, "..\bitmaps\rbnmenu.bmp", { || MsgInfo( "action" ) }, oRBar ,;
                         ,,,,,, .T., .T.,,,,,, "POPUP", oMenu,,,,,,,,,,,,, aClrMenu1, nRGB( 125, 172, 215 ),;
                         nRGB( 65, 106, 189 ) ) 
   oTBtn0:aClrGradOver = { || aClrMenu2 }
   oTBtn0:bClrGradSubOver = { || aClrMenu2 }
                         
   oTBtn1 = TRBtn():New( 4, 410,,, "..\bitmaps\16x16\new2.bmp", {|| MsgInfo( "new" ) }, oRBar ) 

   oTBtn2 = TRBtn():New( 4, 435,,, "..\bitmaps\16x16\open2.bmp", {|| MsgInfo( "open" ) }, oRBar ) 

   oTBtn3 = TRBtn():New( 4, 460,,, "..\bitmaps\16x16\exit2.bmp", {|| oWnd:End() }, oRBar )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: RIBBON NATIVA AVANCES
Posted: Sun Nov 22, 2009 12:47 PM
Making the mouse over colors even nicer :-)



Code (fw): Select all Collapse
   oTBtn0:aClrGradOver = { || aClrMenu2 }
   oTBtn0:aClrGradBack = aClrMenu2
   oTBtn0:bClrGradSubOver = { || aClrMenu2 }
regards, saludos

Antonio Linares
www.fivetechsoft.com