RIBBONBAR GROUP Resize ?
RIBBONBAR GROUP Resize ?
Hi all
How to resize GROUP of RibbonBar when group is focused od some button of the group is pressed ?
On some ITEMS of RibbonBar i have more groups than can be showed so resizing can help
Best regards,
How to resize GROUP of RibbonBar when group is focused od some button of the group is pressed ?
On some ITEMS of RibbonBar i have more groups than can be showed so resizing can help
Best regards,
Last edited by avista on Fri Feb 27, 2015 9:17 am, edited 2 times in total.
- Antonio Linares
- Site Admin
- Posts: 42513
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 73 times
- Contact:
Re: RIBBONBAR GROUP Resize ?
This is my original ribbon bar
![Image](http://s10.postimg.org/zftbtk7qx/sl1.png)
I want to make it like this ... only first part of the group to be visible
![Image](http://s8.postimg.org/9b1v8jvfp/sl2.png)
But i need to resize GROUP when focused
![Image](http://s17.postimg.org/5bc9nohzj/sl3.png)
Best regards,
![Image](http://s10.postimg.org/zftbtk7qx/sl1.png)
I want to make it like this ... only first part of the group to be visible
![Image](http://s8.postimg.org/9b1v8jvfp/sl2.png)
But i need to resize GROUP when focused
![Image](http://s17.postimg.org/5bc9nohzj/sl3.png)
Best regards,
- Daniel Garcia-Gil
- Posts: 2365
- Joined: Wed Nov 02, 2005 11:46 pm
- Location: Isla de Margarita
- Contact:
Re: RIBBONBAR GROUP Resize ?
Hello
try this way
try this way
Code: Select all | Expand
#include "fivewin.ch"
#include "ribbon.ch"
function main()
local oRBar, oLastG
local oWnd, oGr1, oGr2
DEFINE WINDOW oWnd TITLE "RibbonBar Test " + FWVERSION from 1,1 to 600,600 pixel //brush oBrush1
DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "Config", "Files" HEIGHT 133 TOPMARGIN 25
ADD GROUP oGr1 RIBBON oRBar TO OPTION 1 PROMPT "Clipboard" width 60
oGr1:Cargo = { "STRETCH" => 215, "NORMAL" => 60}
ADD GROUP oGr2 RIBBON oRBar TO OPTION 1 PROMPT "Font" width 60
oGr2:Cargo = { "STRETCH" => 215, "NORMAL" => 60}
oRBar:aDialogs[1]:bMMoved = {||
local oControl
for each oControl in oRBar:aDialogs[1]:aControls
if oControl:isKindof( "TRBGROUP")
if oControl:nWidth == oControl:Cargo["STRETCH"] .AND. ! oControl:lMOver
oControl:SetSize( oControl:Cargo["NORMAL"], oControl:nHeight )
endif
endif
next
oRBar:Refresh()
return 0
}
oGr1:bMMoved = BuildCodeBlockMMoved( oGr1 )
oGr2:bMMoved = BuildCodeBlockMMoved( oGr2 )
ACTIVATE WINDOW oWnd MAXIMIZED
oRBar:End()
return nil
function BuildCodeBlockMMoved( oGroup )
return {| nRow, nCol|
Eval( oGroup:oRB:aDialogs[1]:bMMoved )
oGroup:MouseHover(nRow, nCol)
if oGroup:nWidth != oGroup:Cargo["STRETCH"]
oGroup:setSize( oGroup:Cargo["STRETCH"], oGroup:nHeight)
oGroup:Refresh()
endif
return 0
}
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Re: RIBBONBAR GROUP Resize ?
Daniel,
Thanks for reply
But this sample dont work.
Check it please ?
ribbon5.prg(17) Error E0020 Incomplete statement or unbalanced delimiters
ribbon5.prg(18) Error E0004 LOCAL declaration follows executable statement
ribbon5.prg(28) Error E0030 Syntax error: "syntax error at '}'"
ribbon5.prg(41) Error E0020 Incomplete statement or unbalanced delimiters
ribbon5.prg(43) Warning W0001 Ambiguous reference: 'NROW'
ribbon5.prg(43) Warning W0001 Ambiguous reference: 'NCOL'
ribbon5.prg(49) Error E0030 Syntax error: "syntax error at '}'"
Thanks for reply
But this sample dont work.
Check it please ?
ribbon5.prg(17) Error E0020 Incomplete statement or unbalanced delimiters
ribbon5.prg(18) Error E0004 LOCAL declaration follows executable statement
ribbon5.prg(28) Error E0030 Syntax error: "syntax error at '}'"
ribbon5.prg(41) Error E0020 Incomplete statement or unbalanced delimiters
ribbon5.prg(43) Warning W0001 Ambiguous reference: 'NROW'
ribbon5.prg(43) Warning W0001 Ambiguous reference: 'NCOL'
ribbon5.prg(49) Error E0030 Syntax error: "syntax error at '}'"
- Daniel Garcia-Gil
- Posts: 2365
- Joined: Wed Nov 02, 2005 11:46 pm
- Location: Isla de Margarita
- Contact:
Re: RIBBONBAR GROUP Resize ?
Hello
what compiler are you using?
what compiler are you using?
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
- Daniel Garcia-Gil
- Posts: 2365
- Joined: Wed Nov 02, 2005 11:46 pm
- Location: Isla de Margarita
- Contact:
Re: RIBBONBAR GROUP Resize ?
Avista
try to move the conde inside the oRBar:aDialogs[1]:bMMoved to a funcion
oRBar:aDialogs[1]:bMMoved = {|| myFunction( oRB ) } //example
try to move the conde inside the oRBar:aDialogs[1]:bMMoved to a funcion
oRBar:aDialogs[1]:bMMoved = {|| myFunction( oRB ) } //example
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: RIBBONBAR GROUP Resize ?
I guess he is using xHarbour which does not accept { | | .. } for multiline codeblocks. He should replace with < |nRow,nCol| and end with > in the last line.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: RIBBONBAR GROUP Resize ?
Mr Rao
Thanks this sample working good with your sugestion compiled with xHarbour.
Mr Daniel
Thanks for nice idea.
That is realluy what i need (and others i think)
But unfortunatly dont working good.![Sad :(](./images/smilies/icon_sad.gif)
![Image](http://s24.postimg.org/a04vzpwcl/sl4.png)
Please compile this sample and see the results.
This is VERRYyyyyyyy useful behavior and i think it need to be improved and included in RIBBONBAR class.
Best regards,
Mr.Daniel, Mr.Rao, Mr.Antonio
And i Please for working sample.
Thanks this sample working good with your sugestion compiled with xHarbour.
Mr Daniel
Thanks for nice idea.
That is realluy what i need (and others i think)
But unfortunatly dont working good.
![Sad :(](./images/smilies/icon_sad.gif)
![Image](http://s24.postimg.org/a04vzpwcl/sl4.png)
Please compile this sample and see the results.
Code: Select all | Expand
#include "fivewin.ch"
#include "ribbon.ch"
function main()
local oRBar, oLastG
local oWnd, oGr1, oGr2, oGr3, oGr4, oGr5, oGr6, oGr7, oGr8, oGr9
local oBtn
DEFINE WINDOW oWnd TITLE "RibbonBar Test " + FWVERSION from 1,1 to 600,600 pixel //brush oBrush1
DEFINE RIBBONBAR oRBar WINDOW oWnd ;
PROMPT "Test1", "Test2" ;
HEIGHT 133 TOPMARGIN 25
ADD GROUP oGr1 RIBBON oRBar TO OPTION 1 PROMPT "Group1" width 60
oGr1:Cargo = { "STRETCH" => 215, "NORMAL" => 60}
ADD GROUP oGr2 RIBBON oRBar TO OPTION 1 PROMPT "Group2" width 60
oGr2:Cargo = { "STRETCH" => 215, "NORMAL" => 60}
ADD GROUP oGr3 RIBBON oRBar TO OPTION 1 PROMPT "Group3" width 60
oGr3:Cargo = { "STRETCH" => 215, "NORMAL" => 60}
ADD GROUP oGr4 RIBBON oRBar TO OPTION 1 PROMPT "Group4" width 60
oGr4:Cargo = { "STRETCH" => 215, "NORMAL" => 60}
ADD GROUP oGr5 RIBBON oRBar TO OPTION 1 PROMPT "Group5" width 60
oGr5:Cargo = { "STRETCH" => 215, "NORMAL" => 60}
ADD GROUP oGr6 RIBBON oRBar TO OPTION 1 PROMPT "Group6" width 60
oGr6:Cargo = { "STRETCH" => 215, "NORMAL" => 60}
ADD GROUP oGr7 RIBBON oRBar TO OPTION 1 PROMPT "Group7" width 60
oGr7:Cargo = { "STRETCH" => 215, "NORMAL" => 60}
ADD GROUP oGr8 RIBBON oRBar TO OPTION 1 PROMPT "Group8" width 60
oGr8:Cargo = { "STRETCH" => 215, "NORMAL" => 60}
ADD GROUP oGr9 RIBBON oRBar TO OPTION 1 PROMPT "Group9" width 60
oGr9:Cargo = { "STRETCH" => 215, "NORMAL" => 60}
oRBar:aDialogs[1]:bMMoved = <||
local oControl
for each oControl in oRBar:aDialogs[1]:aControls
if oControl:isKindof( "TRBGROUP")
if oControl:nWidth == oControl:Cargo["STRETCH"] .AND. ! oControl:lMOver
oControl:SetSize( oControl:Cargo["NORMAL"], oControl:nHeight )
endif
endif
next
oRBar:Refresh()
return 0
>
oGr1:bMMoved = BuildCodeBlockMMoved( oGr1 )
oGr2:bMMoved = BuildCodeBlockMMoved( oGr2 )
oGr3:bMMoved = BuildCodeBlockMMoved( oGr3 )
oGr4:bMMoved = BuildCodeBlockMMoved( oGr4 )
oGr5:bMMoved = BuildCodeBlockMMoved( oGr5 )
oGr6:bMMoved = BuildCodeBlockMMoved( oGr6 )
oGr7:bMMoved = BuildCodeBlockMMoved( oGr7 )
oGr8:bMMoved = BuildCodeBlockMMoved( oGr8 )
oGr9:bMMoved = BuildCodeBlockMMoved( oGr9 )
@ 10, 5 ADD BUTTON oBtn PROMPT "Users1" BITMAP "..\bitmaps\users.bmp" ;
GROUP oGr1 SPLITPOPUP ROUND SIZE 50,65
@ 10,65 ADD BUTTON oBtn PROMPT "Add user Group1" BITMAP "..\bitmaps\addrec.bmp";
GROUP oGr1 MOSTLEFT ROUND SIZE 135,20
@ 30,65 ADD BUTTON oBtn PROMPT "Edit user Group1" BITMAP "..\bitmaps\edit.bmp" ;
GROUP oGr1 MOSTLEFT ROUND SIZE 135,20
@ 50,65 ADD BUTTON oBtn PROMPT "Remove user Group1" BITMAP "..\bitmaps\delrec.bmp";
GROUP oGr1 MOSTLEFT ROUND SIZE 135,20
@ 10, 5 ADD BUTTON oBtn PROMPT "Users2" BITMAP "..\bitmaps\users.bmp" ;
GROUP oGr2 SPLITPOPUP ROUND SIZE 50,65
@ 10,65 ADD BUTTON oBtn PROMPT "Add user Group2" BITMAP "..\bitmaps\addrec.bmp";
GROUP oGr2 MOSTLEFT ROUND SIZE 135,20
@ 30,65 ADD BUTTON oBtn PROMPT "Edit user Group2" BITMAP "..\bitmaps\edit.bmp" ;
GROUP oGr2 MOSTLEFT ROUND SIZE 135,20
@ 50,65 ADD BUTTON oBtn PROMPT "Remove user Group2" BITMAP "..\bitmaps\delrec.bmp";
GROUP oGr2 MOSTLEFT ROUND SIZE 135,20
@ 10, 5 ADD BUTTON oBtn PROMPT "Users3" BITMAP "..\bitmaps\users.bmp" ;
GROUP oGr3 SPLITPOPUP ROUND SIZE 50,65
@ 10,65 ADD BUTTON oBtn PROMPT "Add user Group3" BITMAP "..\bitmaps\addrec.bmp";
GROUP oGr3 MOSTLEFT ROUND SIZE 135,20
@ 30,65 ADD BUTTON oBtn PROMPT "Edit user Group3" BITMAP "..\bitmaps\edit.bmp" ;
GROUP oGr3 MOSTLEFT ROUND SIZE 135,20
@ 50,65 ADD BUTTON oBtn PROMPT "Remove user Group3" BITMAP "..\bitmaps\delrec.bmp";
GROUP oGr3 MOSTLEFT ROUND SIZE 135,20
@ 10, 5 ADD BUTTON oBtn PROMPT "Users4" BITMAP "..\bitmaps\users.bmp" ;
GROUP oGr4 SPLITPOPUP ROUND SIZE 50,65
@ 10,65 ADD BUTTON oBtn PROMPT "Add user Group4" BITMAP "..\bitmaps\addrec.bmp";
GROUP oGr4 MOSTLEFT ROUND SIZE 135,20
@ 30,65 ADD BUTTON oBtn PROMPT "Edit user Group4" BITMAP "..\bitmaps\edit.bmp" ;
GROUP oGr4 MOSTLEFT ROUND SIZE 135,20
@ 50,65 ADD BUTTON oBtn PROMPT "Remove user Group4" BITMAP "..\bitmaps\delrec.bmp";
GROUP oGr4 MOSTLEFT ROUND SIZE 135,20
@ 10, 5 ADD BUTTON oBtn PROMPT "Users5" BITMAP "..\bitmaps\users.bmp" ;
GROUP oGr5 SPLITPOPUP ROUND SIZE 50,65
@ 10,65 ADD BUTTON oBtn PROMPT "Add user Group5" BITMAP "..\bitmaps\addrec.bmp";
GROUP oGr5 MOSTLEFT ROUND SIZE 135,20
@ 30,65 ADD BUTTON oBtn PROMPT "Edit user Group5" BITMAP "..\bitmaps\edit.bmp" ;
GROUP oGr5 MOSTLEFT ROUND SIZE 135,20
@ 50,65 ADD BUTTON oBtn PROMPT "Remove user Group5" BITMAP "..\bitmaps\delrec.bmp";
GROUP oGr5 MOSTLEFT ROUND SIZE 135,20
@ 10, 5 ADD BUTTON oBtn PROMPT "Users6" BITMAP "..\bitmaps\users.bmp" ;
GROUP oGr6 SPLITPOPUP ROUND SIZE 50,65
@ 10,65 ADD BUTTON oBtn PROMPT "Add user Group6" BITMAP "..\bitmaps\addrec.bmp";
GROUP oGr6 MOSTLEFT ROUND SIZE 135,20
@ 30,65 ADD BUTTON oBtn PROMPT "Edit user Group6" BITMAP "..\bitmaps\edit.bmp" ;
GROUP oGr6 MOSTLEFT ROUND SIZE 135,20
@ 50,65 ADD BUTTON oBtn PROMPT "Remove user Group6" BITMAP "..\bitmaps\delrec.bmp";
GROUP oGr6 MOSTLEFT ROUND SIZE 135,20
@ 10, 5 ADD BUTTON oBtn PROMPT "Users7" BITMAP "..\bitmaps\users.bmp" ;
GROUP oGr7 SPLITPOPUP ROUND SIZE 50,65
@ 10,65 ADD BUTTON oBtn PROMPT "Add user Group7" BITMAP "..\bitmaps\addrec.bmp";
GROUP oGr7 MOSTLEFT ROUND SIZE 135,20
@ 30,65 ADD BUTTON oBtn PROMPT "Edit user Group7" BITMAP "..\bitmaps\edit.bmp" ;
GROUP oGr7 MOSTLEFT ROUND SIZE 135,20
@ 50,65 ADD BUTTON oBtn PROMPT "Remove user Group7" BITMAP "..\bitmaps\delrec.bmp";
GROUP oGr7 MOSTLEFT ROUND SIZE 135,20
@ 10, 5 ADD BUTTON oBtn PROMPT "Users8" BITMAP "..\bitmaps\users.bmp" ;
GROUP oGr8 SPLITPOPUP ROUND SIZE 50,65
@ 10,65 ADD BUTTON oBtn PROMPT "Add user Group8" BITMAP "..\bitmaps\addrec.bmp";
GROUP oGr8 MOSTLEFT ROUND SIZE 135,20
@ 30,65 ADD BUTTON oBtn PROMPT "Edit user Group8" BITMAP "..\bitmaps\edit.bmp" ;
GROUP oGr8 MOSTLEFT ROUND SIZE 135,20
@ 50,65 ADD BUTTON oBtn PROMPT "Remove user Group8" BITMAP "..\bitmaps\delrec.bmp";
GROUP oGr8 MOSTLEFT ROUND SIZE 135,20
@ 10, 5 ADD BUTTON oBtn PROMPT "Users9" BITMAP "..\bitmaps\users.bmp" ;
GROUP oGr9 SPLITPOPUP ROUND SIZE 50,65
@ 10,65 ADD BUTTON oBtn PROMPT "Add user Group9" BITMAP "..\bitmaps\addrec.bmp";
GROUP oGr9 MOSTLEFT ROUND SIZE 135,20
@ 30,65 ADD BUTTON oBtn PROMPT "Edit user Group9" BITMAP "..\bitmaps\edit.bmp" ;
GROUP oGr9 MOSTLEFT ROUND SIZE 135,20
@ 50,65 ADD BUTTON oBtn PROMPT "Remove user Group9" BITMAP "..\bitmaps\delrec.bmp";
GROUP oGr9 MOSTLEFT ROUND SIZE 135,20
ACTIVATE WINDOW oWnd MAXIMIZED
oRBar:End()
return nil
function BuildCodeBlockMMoved( oGroup )
return <| nRow, nCol|
Eval( oGroup:oRB:aDialogs[1]:bMMoved )
oGroup:MouseHover(nRow, nCol)
if oGroup:nWidth != oGroup:Cargo["STRETCH"]
oGroup:setSize( oGroup:Cargo["STRETCH"], oGroup:nHeight)
oGroup:Refresh()
endif
return 0
>
This is VERRYyyyyyyy useful behavior and i think it need to be improved and included in RIBBONBAR class.
Best regards,
Mr.Daniel, Mr.Rao, Mr.Antonio
And i Please for working sample.
Re: RIBBONBAR GROUP Resize ?
Mr. Daniel, Rao, Antonio ...
Please try sample and give me some sugestions
Regards,
Please try sample and give me some sugestions
Regards,
- Daniel Garcia-Gil
- Posts: 2365
- Joined: Wed Nov 02, 2005 11:46 pm
- Location: Isla de Margarita
- Contact:
Re: RIBBONBAR GROUP Resize ?
hello
sorry, it's no easy... seeking one solution for your requested
sorry, it's no easy... seeking one solution for your requested
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Re: RIBBONBAR GROUP Resize ?
Some sugestions ?
I need this behavior
and i still think that this behavior need to be improved and included in RIBBONBAR class
/*----------------------------------------------------------------------------//
//GROUP
------------------------------------------------------------------------------*/
#xcommand ADD GROUP [ <oGr> ] ;
[ <of: RIBBONBAR, RIBBON > <oRBar> ];
[ <to: TO OPTION, TO> <nOption> ];
[ PROMPT <cCaption> ];
[ WIDTH <nWidth> ];
[ ONFOCUSWIDTH <nWidthF> ]; // ????
[ ACTION <uAction> ] ;
[ BITMAP <cBitmap> ] ;
[ GRADIANT <aGradSel> ];
=>;
[ <oGr> := ] <oRBar>:AddGroup( <nWidth>, <nWidthF>, <cCaption>, <nOption>,;
[{|Self|<uAction>}], <cBitmap>, <aGradSel> )
Best regards,
![Idea :idea:](./images/smilies/icon_idea.gif)
I need this behavior
and i still think that this behavior need to be improved and included in RIBBONBAR class
/*----------------------------------------------------------------------------//
//GROUP
------------------------------------------------------------------------------*/
#xcommand ADD GROUP [ <oGr> ] ;
[ <of: RIBBONBAR, RIBBON > <oRBar> ];
[ <to: TO OPTION, TO> <nOption> ];
[ PROMPT <cCaption> ];
[ WIDTH <nWidth> ];
[ ONFOCUSWIDTH <nWidthF> ]; // ????
[ ACTION <uAction> ] ;
[ BITMAP <cBitmap> ] ;
[ GRADIANT <aGradSel> ];
=>;
[ <oGr> := ] <oRBar>:AddGroup( <nWidth>, <nWidthF>, <cCaption>, <nOption>,;
[{|Self|<uAction>}], <cBitmap>, <aGradSel> )
Best regards,