March 08, 2021, 04:17:28 PM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Forum
Help
Search
Gallery
Login
Register
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
BlitzPlus Gui
»
[bb] Advance Toolbar by Red [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] Advance Toolbar by Red [ 1+ years ago ] (Read 754 times)
BlitzBot
Jr. Member
Posts: 1
[bb] Advance Toolbar by Red [ 1+ years ago ]
«
on:
June 29, 2017, 12:28:38 AM »
Title :
Advance Toolbar
Author :
Red
Posted :
1+ years ago
Description :
Download lastest version of this lib: <a href="
http://www.codersworkshop.com/viewshowcase.php?id=21
" target="_blank">here[/url]
Extend toolbar commands
SetToolBarRows(tb, rows)
SetToolBarCols(tb, columns)
DisableToolBar(tb, buttonPos)
EnableToolBar(tb, buttonPos)
LockToolBar(tb, buttonPos)
UnlockToolBar(tb, buttonPos)
SetToolBarState(tb, buttonPos, buttonPushed)
CountToolBarButtons%(tb)
SetToolBarSeparators(tb, separators$)
SetToolBarTips(tb, buttonPos, tip$)
Remarks
- I overrided the B+ command: SetToolBarTips
- SetToolBarRows(tb,0) or SetToolBarCols(tb,0) make toolbar wrapable.
Code :
Code: BlitzBasic
Include
"B+ Advance Toolbar.bb"
;------------------------------------------------
WIN=CreateWindow
(
"Wrapable toolbar example"
,
100
,
100
,
300
,
128
,
0
,
1
+
2
+
8
)
SetStatusText
(
WIN,
"HELP: type SPACE to change toolbar mode"
)
Global
TOOLBAR=CreateToolBar
(
"ide_toolbar.bmp"
,
0
,
0
,
0
,
0
,WIN
)
SetToolBarSeparators TOOLBAR,
"0,4,7,15"
;toolbar separators ( one before button 0, one before button 8)
SetToolBarRows TOOLBAR,
0
;toolbar wrapable mode
;button group
LockToolBarGroup TOOLBAR,
"0,1,2,3"
LockToolBar TOOLBAR,
3
;change button state
SetToolBarState TOOLBAR,
4
,
True
;pressed
SetToolBarState TOOLBAR,
5
,
False
;not pressed
;button activation
EnableToolBar TOOLBAR,
6
;enabled
DisableToolBar TOOLBAR,
7
;disabled
;button tooltip
For
i=
0
To
CountToolBarButtons
(
TOOLBAR
)
-
1
SetToolBarTips TOOLBAR,i,
"button "
+i
Next
;------------------------------------------------
WIN2=CreateWindow
(
""
,
500
,
100
,
0
,
0
,WIN,
1
+
16
+
32
)
TOOLBAR2=CreateToolBar
(
"ide_toolbar.bmp"
,
0
,
0
,
0
,
0
,WIN2
)
LockToolBarGroup TOOLBAR2,
"ALL"
;group all
SetToolBarCols TOOLBAR2,
2
;two columns
FitToolbarShape TOOLBAR2,
2
,
6
;------------------------------------------------
While
Not
EventID
(
)
=$803
WaitEvent
(
)
;press SPACE to change the toolbar mode
If
KeyHit
(
57
)
mode=
(
mode+
1
)
Mod
3
Select
mode
; toolbar wrapable !
Case
0
SetToolBarRows TOOLBAR,
0
; toolbar has 3 rows
Case
1
SetToolBarRows TOOLBAR,
3
; toolbar has 8 rows
Case
2
SetToolBarRows TOOLBAR,
14
End Select
EndIf
Wend
Comments :
Red(Posted 1+ years ago)
[updated]
JoshK(Posted 1+ years ago)
You need to add the StringBank include file.
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
BlitzPlus Gui
»
[bb] Advance Toolbar by Red [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal