Page 1 of 3

Libs : ToolbarPlus

Posted: Mon Aug 01, 2005 7:44 pm
by eddy
:arrow: new version for PB 4.30 : http://www.purebasic.fr/english/viewtop ... ht=toolbar

Download library (OLD VERSION) : ToolbarPlus.zip ( Extract to your PB folder and restart your PB compiler. )

Its a hack of PB standard toolbar. It's an improved version of my tip : old tip

features:
- toolbar popupmenu
- toolbar arrow
- toolbar space
- toolbar combobox
- toolbar string ( returnkey detection)
- toolbar text
- toolbar button
- toolbar checkbox
- toolbar custom popup proc
- toolbar toggle group
- bug fixed : windowblind ( or skinned ) toolbar --> visual bug
- bug fixed : broken PB event gadget
- bug fixed : if toolbar is in container gadgetlist

Image

Posted: Tue Aug 02, 2005 8:02 am
by dige
Yes, works fine here ( winxp, sp2 )

Posted: Tue Aug 02, 2005 11:44 pm
by eddy
Yes, works fine here ( winxp, sp2 )
great :)
I need windowblind users too

Posted: Tue Aug 02, 2005 11:55 pm
by eddy
[ UPDATED ]
new betatest version:
- returnkey event for string gadget
- dropdown arrow
- popup menu
- bug fixed : gadget events

Code: Select all

;toolbar popup menu
ToolBarStandardButton(1, #PB_ToolBarIcon_New)
ToolBarToolTip(1,"here : dropdown menu")
SetToolBarArrow(#True)
SetToolBarMenu(1) 

ToolBarStandardButton(2, #PB_ToolBarIcon_New)
ToolBarToolTip(2,"here : dropdown menu (separated arrow)") 
SetToolBarArrow(#False)
SetToolBarMenu(1) 

ToolBarStandardButton(3, #PB_ToolBarIcon_New)
ToolBarToolTip(3,"here : dropdown menu (button)") 
SetToolBarMenu(1) 

;toolbar space
ToolBarSpace(10) 

;toolbar combobox
If ToolbarCombobox(4,0,0,100,100,0)
   AddGadgetItem(4,-1,"combo 1")
   SetGadgetState(4,2)  
EndIf

;toolbar string
ToolbarString(5,0,0,70,21,"blabla",0)

Posted: Wed Aug 03, 2005 8:48 am
by eddy
[RELEASED]

version 1.0

Posted: Wed Aug 03, 2005 9:36 pm
by Progi1984
Good job Eddy !

well done

Posted: Thu Aug 04, 2005 10:24 am
by pantsonhead
Excellent job Eddy - just what I needed.

I had coded some of this functionality using this approach:

Code: Select all

CreateGadgetList(hndToolBar)
ComboBoxGadget(#gCmbZoom,210,2,50,150,#PB_ComboBox_Editable)
But your lib is much handier :)

Any plans for allowing icons in menuitems?

Thanks,
pantsonhead

Posted: Thu Aug 04, 2005 1:56 pm
by GeoTrail
WPW, that is really cool.
Great work eddy :)

Posted: Thu Aug 04, 2005 3:39 pm
by eddy
Thx :)
pantsonhead wrote:I had coded some of this functionality using this approach:

Code: Select all

CreateGadgetList(hndToolBar)
ComboBoxGadget(#gCmbZoom,210,2,50,150,#PB_ComboBox_Editable)
But your lib is much handier :)
Any plans for allowing icons in menuitems?
Me too, I used the same approach in my first version but I had some problems to maintain PB events.

Menu icons ? perhaps

Menu lib

Posted: Fri Aug 05, 2005 3:21 pm
by pantsonhead
I guess "Menu icons" should really be in a Menu lib

These are the functions I would like to see wrappered in a Menu lib.
Any other suggestions?

Code: Select all

Procedure.b MenuSetCheckImages(hMenu.l, MenuItem.l, img1ID, img2ID)
  result.b=#False
  If IsImage(img1ID) And IsImage(img2ID)
    result= SetMenuItemBitmaps_(hMenu,MenuItem,#MF_BYCOMMAND,UseImage(img1ID),UseImage(img2ID))
  EndIf
  ProcedureReturn result
EndProcedure
     
Procedure.b MenuModifyAsBmp(hMenu.l, item.l, imgID)
  result.b = #False 
  If IsImage(imgID)
    result =  ModifyMenu_(hMenu, item, #MF_BITMAP, item, UseImage(imgID))
  EndIf
  ProcedureReturn result
EndProcedure

Procedure.s GetMenuItemText(menu,item)
  b$=Space(127)
  a=GetMenuString_(menu,item,@b$,127,#MF_BYCOMMAND)
  ProcedureReturn Mid(b$,1,a)
EndProcedure

Posted: Fri Aug 05, 2005 3:27 pm
by GeoTrail
How about a lib with Office XP style menus?

additions to Toolbar lib

Posted: Fri Aug 05, 2005 3:59 pm
by pantsonhead
Hi again Eddy,

Perhaps the radio/toggle toolbar button stuff would be a good addition to your lib.

Example code here:
viewtopic.php?t=10090

Maybe you could put this in version 1.1 :wink:


regards,
pantsonhead

Posted: Wed Aug 10, 2005 3:07 am
by eddy
W.I.P - version 1.1
- toolbar checkbox
- toolbar custom popup proc
- toolbar toggle group
- bug fixed : if toolbar is in container gadgetlist
- bug fixed : unwanted toolbar events

Posted: Wed Aug 10, 2005 11:42 am
by Pantcho!!
Thanks! great util! :)

Posted: Wed Aug 10, 2005 5:33 pm
by eddy
:)

I updated the app test. (look above)

custom popup example :
Image