CyberSlug Posted October 4, 2004 Share Posted October 4, 2004 (edited) Can a checkbox with the BS_PUSHLIKE style display an image/icon like ordinary buttons? I'd like to mimic the functionality in the attached screenshot from Visual Basic 6... GuiCreate("Example...") GUICtrlCreateCheckbox("I want an image here", 10, 10, 140, 40, 0x1000);BS_PUSHLIKE GUICtrlCreateButton("button", 60, 60, 40, 40, 0x40);BS_ICON GuiCtrlSetImage (-1, "shell32.dll",22) GUICtrlCreateCheckbox("I want an image here", 110, 110, 40, 40, BitOr(0x40, 0x1000)) GuiCtrlSetImage (-1, "shell32.dll",22) GuiSetState() While GuiGetMsg() <> -3;$GUI_EVENT_CLOSE WEnd 17 Oct 04: I thought I'd remove the attachment to free up some server space. AutoIt has the feature now Edited October 18, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
jpm Posted October 4, 2004 Share Posted October 4, 2004 (edited) Can a checkbox with the BS_PUSHLIKE style display an image/icon like ordinary buttons? I'd like to mimic the functionality in the attached screenshot from Visual Basic 6...GuiCreate("Example...") GUICtrlCreateCheckbox("I want an image here", 10, 10, 140, 40, 0x1000);BS_PUSHLIKE GUICtrlCreateButton("button", 60, 60, 40, 40, 0x40);BS_ICON GuiCtrlSetImage (-1, "shell32.dll",22) GUICtrlCreateCheckbox("I want an image here", 110, 110, 40, 40, BitOr(0x40, 0x1000)) GuiCtrlSetImage (-1, "shell32.dll",22) GuiSetState() While GuiGetMsg() <> -3;$GUI_EVENT_CLOSE WEnd<{POST_SNAPBACK}>I don't think vb is doing what you circle and what you described. VB is the circle is doing the GuiCtrlCreateGroup. I don't understand the power of making a button with a GuiCtrlCreateCheckbox. can you explain? Thanks Edited October 4, 2004 by jpm Link to comment Share on other sites More sharing options...
CyberSlug Posted October 4, 2004 Author Share Posted October 4, 2004 (edited) I don't think vb is doing what you circle and what you described. VB is the circle is doing the GuiCtrlCreateGroup. I don't understand the power of making a button with a GuiCtrlCreateCheckbox. can you explain? Thanks<{POST_SNAPBACK}>The control I selected is "pushed in" to show that it is selected. That is the power of the GuiCtrlCreateCheckbox/BS_PUSHLIKE.Otherwise, I'll need to create a normal button and change the image depdending on the "button state"...EDIT: Thanks for the suggestion, Larry. I'll try that. Edited October 4, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
jpm Posted October 4, 2004 Share Posted October 4, 2004 The control I selected is "pushed in" to show that it is selected. That is the power of the GuiCtrlCreateCheckbox/BS_PUSHLIKE.Otherwise, I'll need to create a normal button and change the image depdending on the "button state"...EDIT: Thanks for the suggestion, Larry. I'll try that.<{POST_SNAPBACK}>Thanks for the clarification. I was thinking that this State can be handle by a button control with a specific style not with a checkbox.If not it is easy to to the same as for button for checkbox. Link to comment Share on other sites More sharing options...
CyberSlug Posted October 4, 2004 Author Share Posted October 4, 2004 (edited) The BS_PUSHLIKE style does not work on buttons, and I don't see anything similar My ultimate goal is like this (but with images instead of text): Global $BS_PUSHLIKE = 0x1000, $GUI_CHECKED = 1 GuiCreate("Choose", 132,234,(@DesktopWidth-132)/2, (@DesktopHeight-234)/2 , 0x04CF0000) $button_1 = GUICtrlCreateRadio("Cursor", 10, 10, 50, 50, $BS_PUSHLIKE) $button_2 = GUICtrlCreateRadio("Button", 60, 10, 50, 50, $BS_PUSHLIKE) $button_3 = GUICtrlCreateRadio("Radio", 10, 60, 50, 50, $BS_PUSHLIKE) $button_4 = GUICtrlCreateRadio("Chkbox", 60, 60, 50, 50, $BS_PUSHLIKE) $button_5 = GUICtrlCreateRadio("Label", 10, 110, 50, 50, $BS_PUSHLIKE) $button_6 = GUICtrlCreateRadio("Edit", 60, 110, 50, 50, $BS_PUSHLIKE) $button_7 = GUICtrlCreateRadio("List", 10, 160, 50, 50, $BS_PUSHLIKE) $button_8 = GUICtrlCreateRadio("Combo", 60, 160, 50, 50, $BS_PUSHLIKE) GuiCtrlSetState($button_1, $GUI_CHECKED) GuiSetState() While GuiGetMsg() <> -3 WEnd Exit Edited October 4, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Holger Posted October 4, 2004 Share Posted October 4, 2004 (edited) @Jon: it should be no problem to add the "checkbox" to the CtrlSetImage-function (I tested it and it works)@Jon: if Jon makes a change then you could it use your lines like you did:GUICtrlCreateCheckbox("I want an image here", 110, 110, 40, 40, BitOr($BS_ICON, $BS_PUSHLIKE)) GuiCtrlSetImage (-1, "shell32.dll",22)Regards HolgerEdit: forgot something: @Jon: could you please change the maximum menuitem creation parameters to 4?The 4th is the setting of a radiomenuitem (1 = radio, other = normal menuitem).It is already in the creation function, only 3 have to change to 4 Thanks Edited October 4, 2004 by Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Link to comment Share on other sites More sharing options...
jpm Posted October 4, 2004 Share Posted October 4, 2004 (edited) The BS_PUSHLIKE style does not work on buttons, and I don't see anything similar My ultimate goal is like this (but with images instead of text):Global $BS_PUSHLIKE = 0x1000, $GUI_CHECKED = 1 GuiCreate("Choose", 132,234,(@DesktopWidth-132)/2, (@DesktopHeight-234)/2 , 0x04CF0000) $button_1 = GUICtrlCreateRadio("Cursor", 10, 10, 50, 50, $BS_PUSHLIKE) $button_2 = GUICtrlCreateRadio("Button", 60, 10, 50, 50, $BS_PUSHLIKE) $button_3 = GUICtrlCreateRadio("Radio", 10, 60, 50, 50, $BS_PUSHLIKE) $button_4 = GUICtrlCreateRadio("Chkbox", 60, 60, 50, 50, $BS_PUSHLIKE) $button_5 = GUICtrlCreateRadio("Label", 10, 110, 50, 50, $BS_PUSHLIKE) $button_6 = GUICtrlCreateRadio("Edit", 60, 110, 50, 50, $BS_PUSHLIKE) $button_7 = GUICtrlCreateRadio("List", 10, 160, 50, 50, $BS_PUSHLIKE) $button_8 = GUICtrlCreateRadio("Combo", 60, 160, 50, 50, $BS_PUSHLIKE) GuiCtrlSetState($button_1, $GUI_CHECKED) GuiSetState() While GuiGetMsg() <> -3 WEnd Exit<{POST_SNAPBACK}>When I say State I mean Style as you understand. So if there is no style i will send change for checkbox with image to JON.EDIT: the easiest modification just one C line to add in CtrlSetImage but $BS_PUSHLIKE+$BS_ICON needed Edited October 4, 2004 by jpm Link to comment Share on other sites More sharing options...
CyberSlug Posted October 4, 2004 Author Share Posted October 4, 2004 Make sure to also upload the change for radio buttons Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
jpm Posted October 5, 2004 Share Posted October 5, 2004 Make sure to also upload the change for radio buttons <{POST_SNAPBACK}>for sure tha's first in modification line Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now