Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Image on BS_PUSHLIKE checkbox


  • Please log in to reply
8 replies to this topic

#1 CyberSlug

CyberSlug

    Overwhelmed with work....

  • MVPs
  • 3,587 posts

Posted 04 October 2004 - 01:55 AM

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 by CyberSlug, 18 October 2004 - 02:45 AM.

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!







#2 jpm

jpm

    a Real GUI/debug lover

  • Developers
  • 9,689 posts

Posted 04 October 2004 - 09:55 AM

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 by jpm, 04 October 2004 - 10:06 AM.


#3 CyberSlug

CyberSlug

    Overwhelmed with work....

  • MVPs
  • 3,587 posts

Posted 04 October 2004 - 12:39 PM

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 by CyberSlug, 04 October 2004 - 12:40 PM.

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

#4 jpm

jpm

    a Real GUI/debug lover

  • Developers
  • 9,689 posts

Posted 04 October 2004 - 02:42 PM

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. :)

#5 CyberSlug

CyberSlug

    Overwhelmed with work....

  • MVPs
  • 3,587 posts

Posted 04 October 2004 - 03:59 PM

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 by CyberSlug, 04 October 2004 - 04:02 PM.

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

#6 Holger

Holger

    AutoIt Spammer

  • Developers
  • 1,384 posts

Posted 04 October 2004 - 06:52 PM

@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 Holger

Edit: 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 by Holger, 04 October 2004 - 06:54 PM.


#7 jpm

jpm

    a Real GUI/debug lover

  • Developers
  • 9,689 posts

Posted 04 October 2004 - 06:52 PM

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 by jpm, 04 October 2004 - 08:52 PM.


#8 CyberSlug

CyberSlug

    Overwhelmed with work....

  • MVPs
  • 3,587 posts

Posted 04 October 2004 - 09:47 PM

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!

#9 jpm

jpm

    a Real GUI/debug lover

  • Developers
  • 9,689 posts

Posted 05 October 2004 - 07:52 AM

Make sure to also upload the change for radio buttons :)

<{POST_SNAPBACK}>

for sure tha's first in modification line :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users