How to create pushed toggle button?
-
- User
- Posts: 53
- Joined: Wed Nov 01, 2006 3:02 pm
- Location: Russia/Krasnoyarsk
- Contact:
How to create pushed toggle button?
How I can create PUSHED toggle button?
I want to create this: my program launches and reads settings - and in one case someone toggle button is pushed, in another case it's released...
I can't find ANY info about ButtonGadgets commands in PureBasic Help... are they supported?
Please, use simple english. My english is too far from perfect.
I want to create this: my program launches and reads settings - and in one case someone toggle button is pushed, in another case it's released...
I can't find ANY info about ButtonGadgets commands in PureBasic Help... are they supported?
Please, use simple english. My english is too far from perfect.
Win Api:
For example,
Code: Select all
SendMessage_(GadgetID(#togglebutton), #BM_CLICK, 0, 0)
Code: Select all
If OpenWindow(0, 0, 0, 222, 200, "ButtonGadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
ButtonGadget(4, 10,10, 80, 40, "Toggle", #PB_Button_Toggle)
SendMessage_(GadgetID(4), #BM_CLICK, 0, 0)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
I may look like a mule, but I'm not a complete ass.
-
- Addict
- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact:
- netmaestro
- PureBasic Bullfrog
- Posts: 8433
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
-
- User
- Posts: 53
- Joined: Wed Nov 01, 2006 3:02 pm
- Location: Russia/Krasnoyarsk
- Contact:
-
- Enthusiast
- Posts: 665
- Joined: Fri Sep 12, 2003 10:40 pm
- Location: Tallahassee, Florida
SendMessage_(GadgetID(#togglebutton), #BM_SETCHECK, 0, state)
Code: Select all
!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
-
- Addict
- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact:
Re: How to create pushed toggle button?
I know that the purebasic has a flag #PB_Button_Toggle, but I would like to receive it by api.How I can create PUSHED toggle button?
can you help?
Re: How to create pushed toggle button?
Why?
Is native for all OS
Is native for all OS
Code: Select all
SendMessage_(GadgetID(4), #BM_GETCHECK, 0, 0)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: How to create pushed toggle button?
I meant this.
I know that purebasic has the flag #PB_Button_Toggle, but I would like to get the same result with winapi.
you can help?
SetWindowLongPtr_(handle, #GWL_STYLE, GetWindowLongPtr_(handle, #GWL_STYLE)|#BS_PUSHLIKE|#BS_CHECKBOX)
I know that purebasic has the flag #PB_Button_Toggle, but I would like to get the same result with winapi.
you can help?
SetWindowLongPtr_(handle, #GWL_STYLE, GetWindowLongPtr_(handle, #GWL_STYLE)|#BS_PUSHLIKE|#BS_CHECKBOX)