January 19, 2021, 09:50:48 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] Two new button styles using API by Cold Harbour [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] Two new button styles using API by Cold Harbour [ 1+ years ago ] (Read 1185 times)
BlitzBot
Jr. Member
Posts: 1
[bb] Two new button styles using API by Cold Harbour [ 1+ years ago ]
«
on:
June 29, 2017, 12:28:42 AM »
Title :
Two new button styles using API
Author :
Cold Harbour
Posted :
1+ years ago
Description :
This code adds two new button styles:
A three state tick box - new state is greyed.
A chunky push button. Can't think of another way to put it.
Code :
Code: BlitzBasic
; .lib "User32.dll"
; SendMessage%(hWnd%,Msg%,wParam%,lParam%):"SendMessageA"
Const
BM_SETSTYLE =
244
Const
BS_AUTO3STATE =
6
Const
BS_DEFPUSHBUTTON =
1
win=CreateWindow
(
"Win"
,
10
,
10
,
600
,
300
,main,
1
)
button1=api_CreateButton
(
"Tickbox with three states"
,
10
,
10
,
300
,
20
,win,BS_AUTO3STATE
)
button2=api_CreateButton
(
"Chunky button"
,
10
,
50
,
200
,
30
,win,BS_DEFPUSHBUTTON
)
While
WaitEvent
(
10
)
<>$803
Wend
End
Function
api_CreateButton
(
title$,x, y, w, h, parent,style
)
button = CreateButton
(
title, x, y, w, h, parent
)
hwnd = QueryObject
(
button,
1
)
SendMessage
(
hwnd, BM_SETSTYLE, style ,
1
)
Return
button
End Function
Comments :
Blaine(Posted 1+ years ago)
It's funny... I found out about the "half-checkable" boxes (as I call them) too! And I did it in the same way! Unfortunately, you need some sort of way to tell how many times the thing's been clicked to find the state, as it will return a ButtonState() of 0 if it's half-checked.
mag.(Posted 1+ years ago)
Crash here on XP. Latest B+ 1.41
KnorxThieus(Posted 1+ years ago)
Hello,I'd be very thankful if someone could update the code for compatibility for Win 8.thx
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
BlitzPlus Gui
»
[bb] Two new button styles using API by Cold Harbour [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal