Defined Group-Colors for Ribbonbar FW 9.07

Re: Defined Group-Colors for Ribbonbar FW 9.07

Postby Daniel Garcia-Gil » Sat Aug 15, 2009 3:03 am

Hello Uwe...

Yes we can set enable/disable any folder

Ribbonbar have a data aEnable, array len = total folder

oRB:aEnable[ 3 ]:= .F.

too have a method Enable( nPos, lOnOff ), return current status, but this have a bug ( showing msginfo, we will solve it soon )
oRB:Enable( 3, .F. ) // Disable folder 3, return .F.
oRB:Enable( 3, .T. ) // Enable folder 3, return .T.
oRB:Enable( ) // return status current folder
oRB:Enable( 3 ) // return status folder 3
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Defined Group-Colors for Ribbonbar FW 9.07

Postby ukoenig » Sat Aug 15, 2009 9:29 am

Hello Daniel,

Thank You very much for the Information.

In some Situations, I don't want to show any Tabs ( like Buttonbar ).
I just define a Folder-Height with Value 1. It works without Error.
oRBar:nHeightFld := 1 // Folder-Height

I still need 2 Values : the left Startposition and Top-Position of the Groups.
They are always painted at Position 0.

Image

Why I cannot include the Ribbon-Soure to my Link-File for testing some Values ?
Doing this, I get a Error. Creating a Exe from Lib, there is no problem.

Application
===========
Path and name: E:\T_RIBBON\Ribbon.exe (32 bits)
Size: 1,744,384 bytes
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 08/15/09, 13:00:55
Error description: Error BASE/1004 Class: 'NIL' has no exported method: HWND
Args:
[ 1] = U

Stack Calls
===========
Called from: => HWND(0)
Called from: .\TRibbon.PRG => WNDORDER(796)

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Defined Group-Colors for Ribbonbar FW 9.07

Postby Antonio Linares » Sat Aug 15, 2009 11:53 am

Uwe,

Whats the previous calls stack line for ?

Called from: .\TRibbon.PRG => WNDORDER(796)

where is WndOrder() called from ?
regards, saludos

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

Re: Defined Group-Colors for Ribbonbar FW 9.07

Postby ukoenig » Sat Aug 15, 2009 1:27 pm

Antonio,

WNDORDER is nowhere included inside the Application.
here is the Error-Message from Top for RIBBONBAR :

Application
===========
Path and name: E:\T_RIBBON\Ribbon.exe (32 bits)
Size: 1,744,384 bytes
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 08/15/09, 15:18:04
Error description: Error BASE/1004 Class: 'NIL' has no exported method: HWND
Args:
[ 1] = U

Stack Calls
===========
Called from: => HWND(0)
Called from: .\TRibbon.PRG => WNDORDER(796)

System
======
CPU type: Intel(R) Core(TM)2 Duo CPU E7400 @ 2.80GHz 2800 Mhz
Hardware memory: 2048 megs

Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %

Compiler version: xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 6406)
Windows version: 6.0, Build 6002 Service Pack 2

Windows total applications running: 0

Variables in use
================
Procedure Type Value
==========================
HWND
Local 1: A Len: 0
Local 2: U
Local 3: U
WNDORDER
Local 1: U
Local 2: U
Local 3: U
Local 4: N 1
Local 5: A Len: 4
Local 6: A Len: 4
Local 7: U
Local 8: U

Linked RDDs
===========
DBF
DBFFPT
DBFBLOB
DBFNTX

DataBases in use
================

Classes in use:
===============
1 ERROR
2 HASHENTRY
3 HBCLASS
4 HBOBJECT
5 TREG32


// Lines in RMAKE
// -------------------
PRG = \
TRibbon.PRG \
Ribbon.PRG

PROJECT : Ribbon.exe

Ribbon.exe : $(PRG:.PRG=.OBJ) $(C:.C=.OBJ) Ribbon.res
echo off
echo $(BCDIR)\bin\c0w32.obj + > b32.bc

# OBJ-List
# -------------
echo obj\TRibbon.obj \
obj\Ribbon.obj, + >> b32.bc


VTITLE - Test ( with Libs no Problem )
Including ttitle.prg in VTitle-Test also a Error :

Application
===========
Path and name: E:\T_VTITLE\VTitle.exe (32 bits)
Size: 2,014,208 bytes
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 08/15/09, 15:33:09
Error description: Error BASE/1111 Argument error: LEN
Args:
[ 1] = U

Stack Calls
===========
Called from: => LEN(0)
Called from: .\source\classes\BAR.PRG => GRADIENTFILL(900)
Called from: .\TTitle.PRG => GRADIENTBRUSH(852)

System
======
CPU type: Intel(R) Core(TM)2 Duo CPU E7400 @ 2.80GHz 2800 Mhz
Hardware memory: 2048 megs

Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %

Compiler version: xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 6406)
Windows version: 6.0, Build 6002 Service Pack 2

Windows total applications running: 0

Variables in use
================
Procedure Type Value
==========================
LEN
Param 1: U
Local 1: U
Local 2: U
GRADIENTFILL
Param 1: U
Param 2: U
Param 3: U
Param 4: U
Param 5: U
Param 6: U
Local 1: U
Local 2: N 1
Local 3: U
Local 4: U
Local 5: U
GRADIENTBRUSH
Local 1: U
Local 2: U
Local 3: U
Local 4: U
Local 5: U
Local 6: U
Local 7: U
Local 8: N 0
Local 9: N 0

in RMAKE :

PRG = \
TTitle.PRG \
VTitle.PRG

PROJECT : VTitle.exe

VTitle.exe : $(PRG:.PRG=.OBJ) $(C:.C=.OBJ) VTitle.res
echo off
echo $(BCDIR)\bin\c0w32.obj + > b32.bc

# OBJ-List
# -------------
echo obj\ttitle.obj \
obj\vtitle.obj, + >> b32.bc

echo VTitle.exe, + >> b32.bc
echo VTitle.map, + >> b32.bc


Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Defined Group-Colors for Ribbonbar FW 9.07

Postby Antonio Linares » Sat Aug 15, 2009 6:38 pm

Uwe,

It seems as you are linking TRibbon.prg as the main PRG of the EXE.

What other PRGs are you linking ? In which order ?
regards, saludos

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

Re: Defined Group-Colors for Ribbonbar FW 9.07

Postby Antonio Linares » Sat Aug 15, 2009 6:41 pm

Uwe,

Try this change in your make:

# OBJ-List
# -------------
echo obj\Ribbon.obj \
obj\TRibbon.obj, + >> b32.bc
regards, saludos

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

Re: Defined Group-Colors for Ribbonbar FW 9.07

Postby ukoenig » Sat Aug 15, 2009 7:04 pm

Antonio,

Thank You very much.

I changed in Vtitle and Ribbonbar the Obj-Positions.
Both Applications are working now.

Does it mean, they must be always at the End of the List ?

# OBJ-List of my xBrowse-Tools works
# ------------------------------------------
echo obj\xbrowse.obj \
obj\brwtools.obj, + >> b32.bc

( I need it only, to test the different Previews of Value-Changes )

# OBJ-List for Vtitle changed in :
# ------------------------------------
echo obj\VTitle.obj \
obj\TTitle.obj, + >> b32.bc

# OBJ-List for Ribbonbar changed in :
# ------------------------------------------
echo obj\Ribbon.obj \
obj\TRibbon.obj, + >> b32.bc
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Defined Group-Colors for Ribbonbar FW 9.07

Postby Antonio Linares » Sat Aug 15, 2009 7:35 pm

Uwe,

> Does it mean, they must be always at the End of the List ?

No. The problem is that you were using a Class as the main PRG of an application.

The application starts from the first available function, and a Class is preprocessed into a function call too. Thats why we can not place a Class as the first module.
regards, saludos

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

Re: Defined Group-Colors for Ribbonbar FW 9.07

Postby ukoenig » Sun Aug 16, 2009 12:32 pm

Antonio, Daniel

I detected a small Problem :

I must define BarHeight and TopMargin at Runtime, but it works only for Topmargin.
Vtitles included in Ribbonbars works perfect.
Is there a Solution for the Problem ?

Image

Only TopMargin works.
Image

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Defined Group-Colors for Ribbonbar FW 9.07

Postby ukoenig » Sun Aug 16, 2009 9:40 pm

I tested with the original Ribbon.prg from \samples
There is also a difference between the two Previews.

Image

Image

I finished the Basic-Structure of the Tool ( 1. Folder-Page ), to test Changes at Runtime.
I think for the Tabs and Borders I still need a extra Folder-Page.

The Functions :
------------------
1. Position of Top and Height of the Ribbonbar.
2. Distance between Groups.
3. Tab-Dimension ( Height ).
4. Gradient-Defines of the Bar, Groups and Tabs.
5. Text and Fonts.
6. Vtitle-Design and Position inside the Ribbonbar.
7. The Source of all Settings.

To define something included in Groups, makes no sense ( to individual )
and must be defined from the Programmer.
I think a Maximum of 5 Groups will be OK ?

Image

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Defined Group-Colors for Ribbonbar FW 9.07

Postby ukoenig » Wed Aug 19, 2009 4:17 pm

Is there a way to change the Group-Width after the Groups are painted ?

Image

How it works :

1. I start with a empty Bar
2. I define the Group-Width and paint a white Group
3. After the Groups are defined, I fill them with Colors.

After a Group is added, the Group-Status is .T. ( for activated )
If the Group-Status is .T. and the Width-Value is changed, I just want to Resize the Group.
Is there a Method, for resizing a defined Group :
oRBar:????? := aPara[1][4] // new Width
oRBar:Refresh()

I noticed, changing just one Value and starting a new Preview of the existing Ribbonbar,
I got Problems in calculating the new vertical Positions of the groups.
Maybe a better Solution :
Not modifying the Bar, instead using the Source-Button,
destroying the Bar and doing a complete Rebuild with the new Values.

It works, but the old bar is still visible on Top of the new one.
I changed : Top, Bar-Height and Space between Groups

Image

Code: Select all  Expand view


// Source
// --------------
REDEFINE BTNBMP oBtn36 ID 900 OF oFld:aDialogs[1]  2007 ;
FILENAME c_path + "A_Save.bmp" ;
LEFT ;
PROMPT "&Source" ;
FONT oProgFont ;
ACTION ( oFld:aDialogs[1]:Update(), oRbar:Destroy(), NEW_BAR(oWnd, oRbar) )
..
..
// -----------------------------

FUNCTION NEW_BAR(oWnd,oRBar)

DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "      Ribbon-Bar Setup     " ;
HEIGHT 180 TOPMARGIN 60

oRBar:nTop := aPara[1][6]
oRBar:nHeight := aPara[2][6]
oRBar:nHeightFld := aPara[3][6]
oRBar:nGroupSeparation := aPara[4][6]

The new Height and Top comes from the Value-Array !!!!

// 1. Group activated
// ----------------------
oRbar:AddGroup( aPara[1][4], "1", 1 )

// more Groups are defined ???
// ----------------------------------
IF aPara[2][4] > 0
  oRbar:AddGroup( aPara[2][4], "2", 1 )
ENDIF
IF aPara[3][4] > 0
  oRbar:AddGroup( aPara[3][4], "3", 1 )
ENDIF
IF aPara[4][4] > 0
   oRbar:AddGroup( aPara[4][4], "4", 1 )
ENDIF
IF aPara[5][4] > 0
   oRbar:AddGroup( aPara[5][4], "5", 1 )
ENDIF
// Starts the Rebuild
// ---------------------
ChangeColors( oRbar )

oWnd:Refresh() // no Refresh ???

RETURN( NIL )
 


The old Solution :
Code: Select all  Expand view

REDEFINE GET oGrpWidth1  VAR  aPara[1][4]  ID 737 PICTURE "999" OF oFld:aDialogs[1]  UPDATE ;
VALID ( oGrpWidth1:Refresh(), ;
IIF( aPara[1][5] = .F., ( aPara[1][5] := .T., ;  // a new Group is added and Status = .T.
      oRbar:AddGroup( aPara[1][4], "1", 1 ), ;
      ChangeColors( oRbar ) ), ;
    ( oRBar:????? := aPara[1][4], oRBar:Refresh() ) ), .T. ) // with a new Value only Resize because Status = .T.
...
...

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

FUNCTION ChangeColors( oRb )

local hBmp := GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3,;
   oRb:nBottom - oRb:nTopMargin + 1, aBarGrad )

local n, j, z, oControl, cPos, hDC

oRb:aGrad := aBarGrad

DeleteObject( oRb:hBrushEx )
oRb:hBrushEx = CreatePatternBrush( hBmp )
DeleteObject( hBmp )
 
oRb:Refresh()

DeleteObject( oRb:aDialogs[ 1 ]:hBack )
oRb:aDialogs[ 1 ]:hBack = oRb:hBrushEx

// only 1 Control is used with max. 5 Groups !!!
// -----------------------------------------------------
IF ! Empty( oRb:aDialogs[ 1 ]:aControls )
   FOR j = 1 to len( oRb:aDialogs[ 1 ]:aControls )
      oControl = oRb:aDialogs[ 1 ]:aControls[ j ]
      IF oControl:ClassName() == "TRBGROUP"
         cPOS := Alltrim(Str(j))
         DeleteObject( oControl:hBrushUnsel )
         hBmp&cPos := GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3,;
         oRb:nBottom - oRb:nTopMargin + 1, aPara[j][1] )    
         oRb:hBrushEx = CreatePatternBrush( hBmp&cPos )
         DeleteObject( hBmp&cPos )
         oControl:hBrushUnsel = oRb:hBrushEx
         oControl:oFont := aPara[j][2]
         oControl:nClrTxt := aPara[j][3]
         DeleteObject( oControl:hBrushSel )
         oControl:hBrushSel = nil
      ENDIF
   NEXT
ENDIF
oRb:aDialogs[ 1 ]:Refresh()

RETURN NIL

 


Best regards
Uwe :roll:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: wartiaga and 105 guests