AutoHotkey Community

It is currently May 26th, 2012, 7:13 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Graphic Gui's
PostPosted: May 30th, 2009, 1:04 am 
Well sorry for the long wait but school has been in my way. Anywho here is some code that I made a while back to put here but I forgot to. It should allow the changing of an image if a mouse is hovered over the control. There are still flaws in this but im sure this concept or idea can be taken to the next level by someone better in ahk. Please see http://www.autohotkey.com/forum/post-269660.html#269660
Also this was put together in about 20min but I would really like to get some input from people so we can create more types of graphical controls such as tabs, nicer buttons, etc.

The Code:
Code:
Pics= %A_ScriptDir%\tile.gif
IfNotExist %A_ScriptDir%\Stripes.gif
UrlDownloadtoFile, http://www.openwebgraphics.com/resources/data/12/Stripes.gif, %A_ScriptDir%\Stripes.gif
IfNotExist %Pics%
UrlDownloadtoFile, http://www.openwebgraphics.com/resources/data/14/orange_tile.gif, %A_ScriptDir%\tile.gif

Gui, +E0x200 -Sysmenu +ToolWindow
Gui, Margin,0,0

Gui, Add, Picture, x10 y15 w50 h25 E0x200 vButton11 gButton1, %Pics%
Gui, Add, Picture, x10 y15 w50 h25 0x400000 vButton10 gButton1, %Pics%
Gui, Add, Text   , x25 y25 w45 h22 BackgroundTrans cFFFFFF gButton1, Tab 1
Gui, Add, Picture, x10 y15 w50 h25 E0x200 vChange1 gButton1, %A_ScriptDir%\stripes.gif
Gui, Add, Picture, x10 y15 w50 h25 0x400000 vChange2 gButton1, %A_ScriptDir%\stripes.gif
Gui, Font, CRed
Gui, Add, Text   , x25 y25 w45 h22 BackgroundTrans gButton1, Tab 1
Gui, Font
Gui, Show, h300 w250
SetTimer, WatchCursor, 100
Return

esc:: ExitApp

WatchCursor:
MouseGetPos,,,, Tabs
If (Tabs ="Static1" or Tabs = "Static3")
Gosub ChangePic
If (Tabs ="")
{
GuiControl Hide, Change1
GuiControl Hide, Change2
GuiControl Show, Button10
GuiControl Show, Button11
}
Return

ChangePic:
GuiControl Hide, Button10
GuiControl Hide, Button11
GuiControl Show, Change1
GuiControl Show, Change2
Return

Button1:
GuiControl Hide, Change2
KeyWait, LButton, U
GuiControl Show, Change2
Msgbox, You press Button 1
Return

Any help would really be appreciated as I believe users need some scripts for reference to look at that are able to display nice graphics for custom controls if they choose so cause I know the default look of many controls looks very plain. :D


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 31st, 2009, 4:08 pm 
Offline

Joined: May 3rd, 2009, 7:16 pm
Posts: 345
Location: OH, USA
Here are a couple links you might want to check out:

http://www.autohotkey.com/forum/viewtopic.php?t=4047
http://www.autohotkey.com/forum/viewtopic.php?t=40468

Also, you can use OnMessage to monitor WM_NOTIFY messages instead of using a timer.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Scratch, Yahoo [Bot] and 14 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group