Ribbon Bar Sample ?

Ribbon Bar Sample ?

Postby TimStone » Tue Oct 23, 2018 10:06 pm

I have looked at the samples of Ribbon Bar included with FWH 18.xx but they seem very basic.

Currently I use folders and buttonbars to navigate, but would like to consider modifying that to a ribbon bar. It MUST use resources. @ x,y is not consient with my thousands of lines of code.

Does anyone have a sample I could review to better understand how to do this modification ? It would be appreciated.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2942
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Ribbon Bar Sample ?

Postby Antonio Linares » Wed Oct 24, 2018 5:39 am

Tim,

Please build and test FWH\samples\rbdesign.prg

It is a ribbon bar designer, not a very complex one, but enough for starting :-)
regards, saludos

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

Re: Ribbon Bar Sample ?

Postby TimStone » Wed Oct 24, 2018 7:03 pm

OK, so if I use that to create a ribbon bar. When I look at the code, I don't see any reference to the bitmaps being used. I can't find another file beside the .prg being creted.

This utility was last updated in 2011. Is there anything more current ?

I would love to review documentation and more complete samples, but they just are not available matching the most current functions.

If anyone has a more complete sample, I would appreciate the opportunity to view it for understanding. Thanks.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2942
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Ribbon Bar Sample ?

Postby TimStone » Wed Oct 24, 2018 10:38 pm

Let me go further. I took the Ribbon2.prg from the samples, and modified MAIN( ) to a name so I could link this within my program for testing. My program is NOT MDI, but I left this in for testing. Calling the test function will bring up the window with everything except the Ribbon Bar.

Then I took it and removed MDI, and it shows the ribbon bar fully populated, but immediately errors when calling Dialog01.

Does anyone have suggestions ? Here is my slightly modified code:

Code: Select all  Expand view

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


STATIC oWndr
STATIC oDlgRB[3]

function TestRibbon()

   local oRBar
   local oMenu, oMenuWnd, oBrush1
   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 oSay1, oBmp, oFont1
   LOCAL oCursor

   menu oMenu 2007
   endmenu

   DEFINE FONT oFont1 NAME "Arial" SIZE 0,-30 // BOLD
   DEFINE CURSOR oCursor HAND
   DEFINE BRUSH oBrush1 COLOR nRGB(210,210,255) // ,nRGB(255,255,255)
   DEFINE WINDOW oWndr TITLE "RibbonBar Test " + FWVERSION from 1,1 to 600,600 pixel MDI MENU oMenu brush oBrush1

   DEFINE RIBBONBAR oRBar WINDOW oWndr PROMPT "Tab 01", "Tab 02", "Tab 03";
         HEIGHT 130 TOPMARGIN 25

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

     @ 02, 05 ADD BUTTON oBtn2 GROUP oGr BITMAP "c:\fwh\bitmaps\cut16.BMP" ;
       SIZE 75, 20 PROMPT "Dialog 01"  MOSTLEFT round ;
       action ( Dialog01() )

     @ 24, 05 ADD BUTTON oBtn3 GROUP oGr BITMAP "c:\fwh\bitmaps\copy16.BMP" ;
       SIZE 75, 20 PROMPT "Dialog 02"  MOSTLEFT round ;
       action( Dialog02() )

     @ 46, 05 ADD BUTTON oBtn4 GROUP oGr BITMAP "c:\fwh\bitmaps\paste16.BMP" ;
       SIZE 75, 20 PROMPT "Dialog 03"  MOSTLEFT round ;
       action( Dialog03() )

   ADD GROUP oGr1 RIBBON oRBar TO OPTION 1 PROMPT "Font" WIDTH 205

     @ 10, 05 ADD BUTTON oBtn5 GROUP oGr1 BITMAP "c:\fwh\bitmaps\bold16.bmp" GROUPBUTTON FIRST SIZE 25, 20 ROUND ;
     ACTION( oBtn5:lSelected := !oBtn5:lSelected )

     @ 10, 30 ADD BUTTON oBtn6 GROUP oGr1 BITMAP "c:\fwh\bitmaps\italic16.bmp" GROUPBUTTON SIZE 25, 20 ROUND ;
        ACTION( oBtn6:lSelected := !oBtn6:lSelected )

     @ 10, 55 ADD BUTTON oBtn7 GROUP oGr1 BITMAP "c:\fwh\bitmaps\underline16.bmp" GROUPBUTTON SIZE 35, 20 ROUND Popup

     @ 10, 90 ADD BUTTON oBtn8 GROUP oGr1 BITMAP "c:\fwh\bitmaps\strikethru16.bmp" GROUPBUTTON SIZE 25, 20 ROUND;
        ACTION( oBtn8:lSelected := !oBtn8:lSelected )

     @ 10, 115 ADD BUTTON oBtn9 GROUP oGr1 BITMAP "c:\fwh\bitmaps\subindex16.bmp" GROUPBUTTON SIZE 25, 20 ROUND;
        ACTION( oBtn9:lSelected := !oBtn9:lSelected, oBtn10:lSelected := .f., oBtn10:Refresh() )

     @ 10, 140 ADD BUTTON oBtn10 GROUP oGr1 BITMAP "c:\fwh\bitmaps\superindex16.bmp" GROUPBUTTON SIZE 25, 20 ROUND ;
        ACTION( oBtn10:lSelected := !oBtn10:lSelected, oBtn9:lSelected := .f., oBtn9:Refresh() )

     @ 10, 165 ADD BUTTON oBtn11 GROUP oGr1 BITMAP "c:\fwh\bitmaps\casing16.bmp" GROUPBUTTON END SIZE 35, 20 ROUND POPUP

     @ 40, 05 ADD BUTTON oBtn11 GROUP oGr1 BITMAP "c:\fwh\bitmaps\hilight16.bmp" GROUPBUTTON FIRST SIZE 35, 20 ROUND POPUP

     @ 40, 40 ADD BUTTON oBtn12 GROUP oGr1 BITMAP "c:\fwh\bitmaps\fontcolor16.bmp" GROUPBUTTON END SIZE 35, 20 ROUND POPUP

     @ 40, 100 ADD BUTTON oBtn13 GROUP oGr1 BITMAP "c:\fwh\bitmaps\fontsizeincrease16.bmp" GROUPBUTTON FIRST SIZE 25, 20 ROUND

     @ 40, 125 ADD BUTTON oBtn14 GROUP oGr1 BITMAP "c:\fwh\bitmaps\fontsizedecrease16.bmp" GROUPBUTTON END SIZE 25, 20 ROUND

     @ 40, 175 ADD BUTTON oBtn16 GROUP oGr1 BITMAP "c:\fwh\bitmaps\style16.bmp" SIZE 25, 20 ROUND BORDER


   ADD GROUP oGr2 RIBBON oRBar TO OPTION 1 PROMPT "Exit" width 70 // BITMAP "c:\fwh\bitmap\fivetech.bmp"

     @ 15, 20 ADD BUTTON oBtn4 GROUP oGr2 BITMAP "c:\fwh\bitmaps\32x32\quit.BMP" ;
           SIZE 34,52 PROMPT "Exit" action( oWndr:End())

   SET MESSAGE OF oWndr TO "Testing FWH own Class RibbonBar" ;
      CENTERED CLOCK KEYBOARD 2007

   WndCenter(oWnd:hWnd)

   ACTIVATE WINDOW oWndr ON INIT Dialog01() // MAXIMIZED

   oRBar:End()

return nil




Procedure Dialog01()
   LOCAL aCoords:=GetCoors(oWndr:oWndClient), oBrush, oGet, cTxtGet:="Get in Dialog 01"
   LOCAL oFont1, oBmpAlpha
   LOCAL lEscapa:=.F.

   HideDlg( 1 )

   if ValType(oDlgRB[1]) <> "O"
      oBmpAlpha:=TImage():Define(, "c:\fwh\Bitmaps\AlphaBmp\World.bmp" )
      DEFINE FONT oFont1 NAME "Ms Sans Serif" SIZE 0,-8 BOLD
      DEFINE BRUSH oBrush FILE "c:\fwh\Bitmaps\BackGrnd\Stone.bmp"
      DEFINE DIALOG oDlgRB[1] FROM 0,0 TO 538,782 OF oWndr:oWndClient PIXEL // COLORS RGB(0,0,0),RGB(255,255,255)
         oDlgRB[1]:nStyle := nOR(WS_CHILD) // ,WS_THICKFRAME
         oDlgRB[1]:oBrush := oBrush
         oDlgRB[1]:lTransparent := .T.

      @ 20,20 SAY "Some text bla bla bla in DIALOG 01" OF oDlgRB[1] PIXEL COLOR nRGB(0,0,125) FONT oFont1

      @ 35,20 GET oGet VAR cTxtGet OF oDlgRB[1] PIXEL

      ACTIVATE DIALOG oDlgRB[1] NOWAIT ; //CENTERED
          ON INIT (oDlgRB[1]:Move(aCoords[1]+0,aCoords[2]+0,,,.T.));
          ON PAINT (ABPaint( hDC,335,200, oBmpAlpha:hBitmap, 255 ));
          VALID lEscapa
   else
      oDlgRB[1]:Show()
   endif
Return



Procedure Dialog02()
   LOCAL aCoords:=GetCoors(oWndr:oWndClient), oBrush, oGet, cTxtGet:="Get in Dialog 02"
   LOCAL oFont1, oBmpAlpha
   LOCAL lEscapa:=.F.

   HideDlg( 2 )

   if ValType(oDlgRB[2]) <> "O"
      oBmpAlpha:=TImage():Define(, "c:\fwh\Bitmaps\AlphaBmp\World.bmp" )
      DEFINE FONT oFont1 NAME "Ms Sans Serif" SIZE 0,-8 BOLD
      DEFINE BRUSH oBrush FILE "c:\fwh\Bitmaps\BackGrnd\Stone.bmp"
      DEFINE DIALOG oDlgRB[2] FROM 0,0 TO 538,782 OF oWndr:oWndClient PIXEL // COLORS RGB(0,0,0),RGB(255,255,255)
         oDlgRB[2]:nStyle := nOR(WS_CHILD) // ,WS_THICKFRAME
         oDlgRB[2]:oBrush := oBrush
         oDlgRB[2]:lTransparent := .T.

         @ 30,30 SAY "Some text bla bla bla in DIALOG 02" OF oDlgRB[2] PIXEL COLOR nRGB(0,0,125) FONT oFont1

         @ 45,30 GET oGet VAR cTxtGet OF oDlgRB[2] PIXEL

      ACTIVATE DIALOG oDlgRB[2] NOWAIT ; //CENTERED
          ON INIT (oDlgRB[2]:Move(aCoords[1]+0,aCoords[2]+0,,,.T.));
          ON PAINT (ABPaint( hDC,365,230, oBmpAlpha:hBitmap, 255 ));
          VALID lEscapa
   else
      oDlgRB[2]:Show()
   endif
Return




Procedure Dialog03()
   LOCAL aCoords:=GetCoors(oWndr:oWndClient), oBrush, oGet, cTxtGet:="Get in Dialog 03"
   LOCAL oFont1, oBmpAlpha
   LOCAL lEscapa:=.F.

   HideDlg( 3 )

   if ValType(oDlgRB[3]) <> "O"
      oBmpAlpha:=TImage():Define(, "c:\fwh\Bitmaps\AlphaBmp\World.bmp" )
      DEFINE FONT oFont1 NAME "Ms Sans Serif" SIZE 0,-8 BOLD
      DEFINE BRUSH oBrush FILE "c:\fwh\Bitmaps\BackGrnd\Stone.bmp"
      DEFINE DIALOG oDlgRB[3] FROM 0,0 TO 538,782 OF oWndr:oWndClient PIXEL // COLORS RGB(0,0,0),RGB(255,255,255)
         oDlgRB[3]:nStyle := nOR(WS_CHILD) // ,WS_THICKFRAME
         oDlgRB[3]:oBrush := oBrush
         oDlgRB[3]:lTransparent := .T.

         @ 40,40 SAY "Some text bla bla bla in DIALOG 03" OF oDlgRB[3] PIXEL COLOR nRGB(0,0,125) FONT oFont1

         @ 55,40 GET oGet VAR cTxtGet OF oDlgRB[3] PIXEL

      ACTIVATE DIALOG oDlgRB[3] NOWAIT ; //CENTERED
          ON INIT (oDlgRB[3]:Move(aCoords[1]+0,aCoords[2]+0,,,.T.));
          ON PAINT (ABPaint( hDC,395,260, oBmpAlpha:hBitmap, 255 ));
          VALID lEscapa
   else
      oDlgRB[3]:Show()
   endif
Return

Procedure HideDlg( nDlg )
   LOCAL i:=1
   for i:=1 TO Len(oDlgRB)
       if ValType(oDlgRB[i])=="O"
          oDlgRB[i]:Hide()
       endif
   next
Return
 
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2942
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Ribbon Bar Sample ?

Postby James Bott » Thu Oct 25, 2018 12:14 am

Tim,

After looking at it, I think it has to be MDI to run.

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

It errors out on this line because it expects the MDI window to exist.

DEFINE DIALOG oDlgRB[1] FROM 0,0 TO 538,782 OF oWndr:oWndClient PIXEL

I suggest trying panels instead. I haven't tried this but I am pretty sure it will work. You can Hide() the current one and Show() the new one whenever you switch.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Ribbon Bar Sample ?

Postby TimStone » Thu Oct 25, 2018 3:36 pm

James,

The code I used is from the FWH Samples, current version. It clearly does not work properly.

Antonio suggested trying the rbdesign.prg, which I did, but it fails to create and save working code. It has a save feature, but then try to reload it fails. Look at the code and it is very incomplete for what you have created. Try the view code example and it errors out.

So, if anyone is actually using the ribbon bar successfully, I would love to see a full working sample that includes multiple tabs actually defined with bars, and where the action statement actually works with dialogs.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2942
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Ribbon Bar Sample ?

Postby James Bott » Thu Oct 25, 2018 4:43 pm

Tim wrote:
The code I used is from the FWH Samples, current version. It clearly does not work properly.


The original sample is working. Did you try it?

You modified version is not working because you are not using MDI windows for the dialogs.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Ribbon Bar Sample ?

Postby James Bott » Thu Oct 25, 2018 5:38 pm

Tim,

Here is a slightly modified, working version, of your code.


Code: Select all  Expand view
/*
Purpose  : Test Ribbonbar for Tim Stone
Program  : RBar07.prg
Author   : James Bott, jbott@compuserve.com
Date     : 10/25/2018 10:34:25 AM
Company  : Intellitech
Copyright:
Language : Fivewin/xHarbour/BCC
Updated  :
Notes    :

*/



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

STATIC oWndr
STATIC oDlgRB[3]

Function Main()
   
   define window oWndr mdi
 
      TestRibbon()
   
      SET MESSAGE OF oWndr TO "Testing FWH own Class RibbonBar" ;
      CENTERED CLOCK KEYBOARD 2007
   
   activate window oWndr maximized
   
   oRBar:End()
   
Return nil

function TestRibbon()

   local oRBar
   local oMenu, oMenuWnd, oBrush1
   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 oSay1, oBmp, oFont1
   LOCAL oCursor

   //menu oMenu 2007
   //endmenu
/*
   DEFINE FONT oFont1 NAME "Arial" SIZE 0,-30 // BOLD
   DEFINE CURSOR oCursor HAND
   DEFINE BRUSH oBrush1 COLOR nRGB(210,210,255) // ,nRGB(255,255,255)
   DEFINE WINDOW oWndr TITLE "RibbonBar Test " + FWVERSION from 1,1 to 600,600 pixel MDI MENU oMenu brush oBrush1
*/

   DEFINE RIBBONBAR oRBar WINDOW oWndr PROMPT "Tab 01", "Tab 02", "Tab 03";
         HEIGHT 130 TOPMARGIN 25 2016
         

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

     @ 02, 05 ADD BUTTON oBtn2 GROUP oGr BITMAP "c:\fwh\bitmaps\cut16.BMP" ;
       SIZE 75, 20 PROMPT "Dialog 01"  MOSTLEFT round ;
       action ( Dialog01() )

     @ 24, 05 ADD BUTTON oBtn3 GROUP oGr BITMAP "c:\fwh\bitmaps\copy16.BMP" ;
       SIZE 75, 20 PROMPT "Dialog 02"  MOSTLEFT round ;
       action( Dialog02() )

     @ 46, 05 ADD BUTTON oBtn4 GROUP oGr BITMAP "c:\fwh\bitmaps\paste16.BMP" ;
       SIZE 75, 20 PROMPT "Dialog 03"  MOSTLEFT round ;
       action( Dialog03() )

   ADD GROUP oGr1 RIBBON oRBar TO OPTION 1 PROMPT "Font" WIDTH 205

     @ 10, 05 ADD BUTTON oBtn5 GROUP oGr1 BITMAP "c:\fwh\bitmaps\bold16.bmp" GROUPBUTTON FIRST SIZE 25, 20 ROUND ;
     ACTION( oBtn5:lSelected := !oBtn5:lSelected )

     @ 10, 30 ADD BUTTON oBtn6 GROUP oGr1 BITMAP "c:\fwh\bitmaps\italic16.bmp" GROUPBUTTON SIZE 25, 20 ROUND ;
        ACTION( oBtn6:lSelected := !oBtn6:lSelected )

     @ 10, 55 ADD BUTTON oBtn7 GROUP oGr1 BITMAP "c:\fwh\bitmaps\underline16.bmp" GROUPBUTTON SIZE 35, 20 ROUND Popup

     @ 10, 90 ADD BUTTON oBtn8 GROUP oGr1 BITMAP "c:\fwh\bitmaps\strikethru16.bmp" GROUPBUTTON SIZE 25, 20 ROUND;
        ACTION( oBtn8:lSelected := !oBtn8:lSelected )

     @ 10, 115 ADD BUTTON oBtn9 GROUP oGr1 BITMAP "c:\fwh\bitmaps\subindex16.bmp" GROUPBUTTON SIZE 25, 20 ROUND;
        ACTION( oBtn9:lSelected := !oBtn9:lSelected, oBtn10:lSelected := .f., oBtn10:Refresh() )

     @ 10, 140 ADD BUTTON oBtn10 GROUP oGr1 BITMAP "c:\fwh\bitmaps\superindex16.bmp" GROUPBUTTON SIZE 25, 20 ROUND ;
        ACTION( oBtn10:lSelected := !oBtn10:lSelected, oBtn9:lSelected := .f., oBtn9:Refresh() )

     @ 10, 165 ADD BUTTON oBtn11 GROUP oGr1 BITMAP "c:\fwh\bitmaps\casing16.bmp" GROUPBUTTON END SIZE 35, 20 ROUND POPUP

     @ 40, 05 ADD BUTTON oBtn11 GROUP oGr1 BITMAP "c:\fwh\bitmaps\hilight16.bmp" GROUPBUTTON FIRST SIZE 35, 20 ROUND POPUP

     @ 40, 40 ADD BUTTON oBtn12 GROUP oGr1 BITMAP "c:\fwh\bitmaps\fontcolor16.bmp" GROUPBUTTON END SIZE 35, 20 ROUND POPUP

     @ 40, 100 ADD BUTTON oBtn13 GROUP oGr1 BITMAP "c:\fwh\bitmaps\fontsizeincrease16.bmp" GROUPBUTTON FIRST SIZE 25, 20 ROUND

     @ 40, 125 ADD BUTTON oBtn14 GROUP oGr1 BITMAP "c:\fwh\bitmaps\fontsizedecrease16.bmp" GROUPBUTTON END SIZE 25, 20 ROUND

     @ 40, 175 ADD BUTTON oBtn16 GROUP oGr1 BITMAP "c:\fwh\bitmaps\style16.bmp" SIZE 25, 20 ROUND BORDER


   ADD GROUP oGr2 RIBBON oRBar TO OPTION 1 PROMPT "Exit" width 70 // BITMAP "c:\fwh\bitmap\fivetech.bmp"

     @ 15, 20 ADD BUTTON oBtn4 GROUP oGr2 BITMAP "c:\fwh\bitmaps\32x32\quit.BMP" ;
           SIZE 34,52 PROMPT "Exit" action( oWndr:End())

return nil




Procedure Dialog01()
   LOCAL aCoords:=GetCoors(oWndr:oWndClient), oBrush, oGet, cTxtGet:="Get in Dialog 01"
   LOCAL oFont1, oBmpAlpha
   LOCAL lEscapa:=.F.

   HideDlg( 1 )

   if ValType(oDlgRB[1]) <> "O"
      oBmpAlpha:=TImage():Define(, "c:\fwh\Bitmaps\AlphaBmp\World.bmp" )
      DEFINE FONT oFont1 NAME "Ms Sans Serif" SIZE 0,-8 BOLD
      DEFINE BRUSH oBrush FILE "c:\fwh\Bitmaps\BackGrnd\Stone.bmp"
      DEFINE DIALOG oDlgRB[1] FROM 0,0 TO 538,782 OF oWndr:oWndClient PIXEL // COLORS RGB(0,0,0),RGB(255,255,255)
         oDlgRB[1]:nStyle := nOR(WS_CHILD) // ,WS_THICKFRAME
         oDlgRB[1]:oBrush := oBrush
         oDlgRB[1]:lTransparent := .T.

      @ 20,20 SAY "Some text bla bla bla in DIALOG 01" OF oDlgRB[1] PIXEL COLOR nRGB(0,0,125) FONT oFont1

      @ 35,20 GET oGet VAR cTxtGet OF oDlgRB[1] PIXEL

      ACTIVATE DIALOG oDlgRB[1] NOWAIT ; //CENTERED
          ON INIT (oDlgRB[1]:Move(aCoords[1]+0,aCoords[2]+0,,,.T.));
          ON PAINT (ABPaint( hDC,335,200, oBmpAlpha:hBitmap, 255 ));
          VALID lEscapa
   else
      oDlgRB[1]:Show()
   endif
Return



Procedure Dialog02()
   LOCAL aCoords:=GetCoors(oWndr:oWndClient), oBrush, oGet, cTxtGet:="Get in Dialog 02"
   LOCAL oFont1, oBmpAlpha
   LOCAL lEscapa:=.F.

   HideDlg( 2 )

   if ValType(oDlgRB[2]) <> "O"
      oBmpAlpha:=TImage():Define(, "c:\fwh\Bitmaps\AlphaBmp\World.bmp" )
      DEFINE FONT oFont1 NAME "Ms Sans Serif" SIZE 0,-8 BOLD
      DEFINE BRUSH oBrush FILE "c:\fwh\Bitmaps\BackGrnd\Stone.bmp"
      DEFINE DIALOG oDlgRB[2] FROM 0,0 TO 538,782 OF oWndr:oWndClient PIXEL // COLORS RGB(0,0,0),RGB(255,255,255)
         oDlgRB[2]:nStyle := nOR(WS_CHILD) // ,WS_THICKFRAME
         oDlgRB[2]:oBrush := oBrush
         oDlgRB[2]:lTransparent := .T.

         @ 30,30 SAY "Some text bla bla bla in DIALOG 02" OF oDlgRB[2] PIXEL COLOR nRGB(0,0,125) FONT oFont1

         @ 45,30 GET oGet VAR cTxtGet OF oDlgRB[2] PIXEL

      ACTIVATE DIALOG oDlgRB[2] NOWAIT ; //CENTERED
          ON INIT (oDlgRB[2]:Move(aCoords[1]+0,aCoords[2]+0,,,.T.));
          ON PAINT (ABPaint( hDC,365,230, oBmpAlpha:hBitmap, 255 ));
          VALID lEscapa
   else
      oDlgRB[2]:Show()
   endif
Return




Procedure Dialog03()
   LOCAL aCoords:=GetCoors(oWndr:oWndClient), oBrush, oGet, cTxtGet:="Get in Dialog 03"
   LOCAL oFont1, oBmpAlpha
   LOCAL lEscapa:=.F.

   HideDlg( 3 )

   if ValType(oDlgRB[3]) <> "O"
      oBmpAlpha:=TImage():Define(, "c:\fwh\Bitmaps\AlphaBmp\World.bmp" )
      DEFINE FONT oFont1 NAME "Ms Sans Serif" SIZE 0,-8 BOLD
      DEFINE BRUSH oBrush FILE "c:\fwh\Bitmaps\BackGrnd\Stone.bmp"
      DEFINE DIALOG oDlgRB[3] FROM 0,0 TO 538,782 OF oWndr:oWndClient PIXEL // COLORS RGB(0,0,0),RGB(255,255,255)
         oDlgRB[3]:nStyle := nOR(WS_CHILD) // ,WS_THICKFRAME
         oDlgRB[3]:oBrush := oBrush
         oDlgRB[3]:lTransparent := .T.

         @ 40,40 SAY "Some text bla bla bla in DIALOG 03" OF oDlgRB[3] PIXEL COLOR nRGB(0,0,125) FONT oFont1

         @ 55,40 GET oGet VAR cTxtGet OF oDlgRB[3] PIXEL

      ACTIVATE DIALOG oDlgRB[3] NOWAIT ; //CENTERED
          ON INIT (oDlgRB[3]:Move(aCoords[1]+0,aCoords[2]+0,,,.T.));
          ON PAINT (ABPaint( hDC,395,260, oBmpAlpha:hBitmap, 255 ));
          VALID lEscapa
   else
      oDlgRB[3]:Show()
   endif
Return

Procedure HideDlg( nDlg )
   LOCAL i:=1
   for i:=1 TO Len(oDlgRB)
       if ValType(oDlgRB[i])=="O"
          oDlgRB[i]:Hide()
       endif
   next
Return
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Ribbon Bar Sample ?

Postby TimStone » Fri Oct 26, 2018 12:58 am

Actually, I have a very good layout using ButtonBars but I prefer the appearance of the Ribbon ( Groups, Group Titles, etc ).

I do not want an MDI operation. I want to substitute the ribbons for the button bars ... retaining the tabs and using groups with rounded edges. The dialog stays the same for a tab no matter what buttons are used, but each tab has it's own dialog.

Again, the main idea is to get the cleaner appearance. Buttonbars are too boxy.

Ideas ?
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2942
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Ribbon Bar Sample ?

Postby James Bott » Fri Oct 26, 2018 3:49 pm

Tim,

I caution you about being too rigid in what you want before you understand the basics of ribbonbars.

I haven't built a MDI project in many years, so I am not a fan either. But, from the sample program, it appears that this isn't MDI as you know it. These dialogs are not free floating windows like you are thinking of MDI.

Do a net search for "MS Office 2016" and select "images" to get some ideas how the Office apps are using ribbonbars. Searching for MS Project would be a good example. Tabs usually contain things objects, like in your case customers, vehicles, parts, billing, etc. Then buttons would bring up dialogs or browses, etc.

I would also suggest that you should keep an open mind about "boxy." All the new Office apps have a flat square appearance and millions of users are used to this interface. I don't think you can go wrong with emulating what Office looks like. People do judge a book by it's cover. I do. If the interface is outdated, then people wonder about the rest of the program. This is actually what got me started on modifying FW's ribbonbar to look more closely like Office. Have you seen the other current thread titled "Ribbon Theme?"

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Ribbon Bar Sample ?

Postby TimStone » Fri Oct 26, 2018 5:21 pm

James,

Yes I have seen the other thread and followed it also. That is what stimulated me to consider this option.

I have an Office 365 subscription so I've seen multiple implementations of the Ribbon Bar concept. Try looking at Word's implementation versus Outlook. It's actually different.

I also use the latest version of UE Studio, with ribbon bar controls. That is also different. I'm trying to consider if I can modify my user interface to take advantage of what it offers.

The other point is that few of my clients actually use a current version of Word. My objectives are totally driven by keeping them happy at this point because they pay for me to do that. When making changes, the biggerst problem is making sure I don't break things or introduce change too quickly and upset them.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2942
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Ribbon Bar Sample ?

Postby James Bott » Fri Oct 26, 2018 6:08 pm

Tim,

...few of my clients actually use a current version of Word.

Yes, I thought of that after I wrote it. However, they still may see it elsewhere- in ads, surfing the web, etc.

I took a look at some screenshots of your software on your website and it looks like your dialogs are just centered in a window. If so, they could be just placed in a MDI window just as easily. The user would not be able to tell any difference.

As you may have figured out, I am just looking into ribbonbars too, so I don't have any practical knowledge on this yet, but I think it is worth investigating.

When making changes, the biggerst problem is making sure I don't break things or introduce change too quickly and upset them.

I get that. We've all had to deal with it. You may be able to just swap ribbonbars for your current buttonbars. The norm is to only have one ribbonbar, but maybe you can have multiple ones. You could even just start out with one ribbonbar on the main window. Then introduce more if that goes well.
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Ribbon Bar Sample ?

Postby TimStone » Fri Oct 26, 2018 6:16 pm

James,

I hope to release a new UPGRADE in the 1st quarter of 2019. Updates are made all the time, but upgrades usually include some significant internal changes and modifications of the user interface.

The main reason I do not do MDI is my clients race through, forget ( and never check ) what they have open, and often create havoc. Some have many machines ( up to 20 in some locations ), and it is not unusual for a person to open a Workorder on one computer, go to another and add to it while it is open on the first, and sometimes the system minimizes the programs, and they open up another copy of the program.

I have built traps for all of the issues I have encountered. You can only open the program once. It checks date/time stamps before saving an invoice, etc. They don't have issues now because of the structures I've built in. However I have carefully monitored the behaviors and on the few times I've allowed MDI, the users were not careful enough to use it wisely. So moving forward with them has to be very cautious.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2942
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Ribbon Bar Sample ?

Postby James Bott » Sat Oct 27, 2018 3:58 pm

Tim,

Usually you use pessimistic locking for those types of situations. You lock the invoice when it is opened and don't unlock it until it is closed. You could even use a timer so that after a certain time it saves and then closes itself. Maybe that is what you are doing.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 38 guests