Vicks Posted July 13, 2006 Posted July 13, 2006 can you shape a button, i know you can shape a GUI, but have no clue on shaping a button, and if you can't well i guess that will be a new project for me with the help of larrys script [s]Autoit[/s]
Xenobiologist Posted July 13, 2006 Posted July 13, 2006 HI, what do you exactly mean with shape? There are so many translations. :"> You can set a pic on it to make it look better. So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
Vicks Posted July 13, 2006 Author Posted July 13, 2006 (edited) to carve it in to squares or circles or w/e, but doesn't adding a picture cut in out in to that shape or was that icons hmm? -so i guess nobody made something like this Edited July 13, 2006 by Vicks [s]Autoit[/s]
spyrorocks Posted July 14, 2006 Posted July 14, 2006 it would be cool to be able to shape a button. [center] My Projects: Online AutoIt Compiler - AutoForum - AutoGuestbook - AutoIt Web-based Auto Installer - Pure AutoIt Zipping Functions - ConfuseGen - MindReader - P2PChat[/center]
ChrisL Posted July 14, 2006 Posted July 14, 2006 What I have done before is to use GuiCtrlCreatePic() not a button, then in the $Msg= loop look for the image being clicked, then have an while _ispressed (left mouse button) swap the image to a picture with shading that looks pressed. Then swap it back to the not pressed image on mouse up. [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
livewire Posted July 14, 2006 Posted July 14, 2006 Here is what you're looking for, but the control gets redrawn for some reason. Gafrost or someone may know how to make it work. #include <GUIConstants.au3> GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Button_1 = GuiCtrlCreateButton("Button1", 70, 60, 150, 80) GuiSetState() ;_ControlToRoundedRectangle($Button_1,0,0,40,80,10,10) _ControlToEllipse($Button_1,90,90) While 1 $msg = GuiGetMsg() Select Case $msg = $Button_1 MsgBox(0,"Testing","You Clicked It!") Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Func _ControlToRoundedRectangle($aControl,$X1,$Y1,$X2,$Y2,$X3,$Y3) Local $l Local $handle = GUICtrlGetHandle($aControl) $l = DllCall("gdi32.dll","int","CreateRoundRectRgn","int",$X1,"int",$Y1,"int",$X2,"int",$Y2,"int",$X3,"int",$Y3) DllCall("user32.dll","int","SetWindowRgn","hwnd",$handle,"int",$l[0],"int",True) EndFunc Func _ControlToEllipse($aControl,$width,$height) Local $l Local $handle = GUICtrlGetHandle($aControl) $l = DllCall("gdi32.dll","int","CreateEllipticRgn","int",0,"int",0,"int",$width,"int",$height) DllCall("user32.dll","int","SetWindowRgn","hwnd",$handle,"int",$l[0],"int",1) EndFunc
Vicks Posted July 14, 2006 Author Posted July 14, 2006 (edited) Here is what you're looking for, but the control gets redrawn for some reason. Gafrost or someone may know how to make it work. #include <GUIConstants.au3> GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Button_1 = GuiCtrlCreateButton("Button1", 70, 60, 150, 80) GuiSetState() ;_ControlToRoundedRectangle($Button_1,0,0,40,80,10,10) _ControlToEllipse($Button_1,90,90) While 1 $msg = GuiGetMsg() Select Case $msg = $Button_1 MsgBox(0,"Testing","You Clicked It!") Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Func _ControlToRoundedRectangle($aControl,$X1,$Y1,$X2,$Y2,$X3,$Y3) Local $l Local $handle = GUICtrlGetHandle($aControl) $l = DllCall("gdi32.dll","int","CreateRoundRectRgn","int",$X1,"int",$Y1,"int",$X2,"int",$Y2,"int",$X3,"int",$Y3) DllCall("user32.dll","int","SetWindowRgn","hwnd",$handle,"int",$l[0],"int",True) EndFunc Func _ControlToEllipse($aControl,$width,$height) Local $l Local $handle = GUICtrlGetHandle($aControl) $l = DllCall("gdi32.dll","int","CreateEllipticRgn","int",0,"int",0,"int",$width,"int",$height) DllCall("user32.dll","int","SetWindowRgn","hwnd",$handle,"int",$l[0],"int",1) EndFuncwow thanks just what i needed, now i hope gafrost or some other GUI wizard helps unless i figure it out, which won't happen because im going to my cottage for the rest of the weekend, another thing if you don't mind how did you make this wonderful example, just pure skills? Edited July 14, 2006 by Vicks [s]Autoit[/s]
livewire Posted July 14, 2006 Posted July 14, 2006 I made it by searching VB forums, this AutoIt forum, and stealing borrowing code.
marfdaman Posted July 14, 2006 Posted July 14, 2006 (edited) Check my sig for a way to do this without flickering. Lots of examples too Edited July 14, 2006 by marfdaman Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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