Jump to content

GUICtrlCreatePic


Recommended Posts

I have this code and I want the icons to sit on top of the image, [ mattsadminbar.jpg ] however when I run it, the icons break the picture up - is there something else I need to do to make the icons and labels sit on top of it ?

It looks like this:

Posted Image

#include <GUIConstants.au3>

GUICreate(" Admin Bar ", 150, 700, 20, 20)

GUICtrlCreatePic(@WindowsDir & "\cursors\mattsadminbar.jpg", 20, 20, 150, 700)

$n1 = GUICtrlCreateIcon(@WindowsDir & "\cursors\rdp.ico", -1, 10, 20, 20)
GUICtrlCreateLabel("RDP", 10, 60, 60)
$n2 = GUICtrlCreateIcon(@WindowsDir & "\cursors\delprof.ico", -1, 10, 80, 80)
GUICtrlCreateLabel("DelProf", 10, 120, 120)
$n3 = GUICtrlCreateIcon(@WindowsDir & "\cursors\fpolicy.ico", -1, 10, 140, 140)
GUICtrlCreateLabel("Fpolicy", 10, 180,180)
$n4 = GUICtrlCreateIcon(@WindowsDir & "\cursors\wexplore.ico", -1, 10, 200, 200)
GUICtrlCreateLabel("Files", 10, 240, 240)
$n5 = GUICtrlCreateIcon(@WindowsDir & "\cursors\reboot.ico", -1, 10, 260, 260)
GUICtrlCreateLabel("Reboot", 10, 300, 300)
$n6 = GUICtrlCreateIcon(@WindowsDir & "\cursors\Scd.ico", -1, 10, 320, 320)
GUICtrlCreateLabel("Srv CD", 10, 360, 360)
$n7 = GUICtrlCreateIcon(@WindowsDir & "\cursors\wupdate.ico", -1, 10, 380, 380)
GUICtrlCreateLabel("Win Upt", 10, 420, 420)
$n8 = GUICtrlCreateIcon(@WindowsDir & "\cursors\vnc.ico", -1, 10, 440, 440)
GUICtrlCreateLabel("VNC", 10, 480, 480)
$n9 = GUICtrlCreateIcon(@WindowsDir & "\cursors\appman.ico", -1, 10, 500, 500)
GUICtrlCreateLabel("Prism", 10, 540, 540)
$n10 = GUICtrlCreateIcon(@WindowsDir & "\cursors\userman.ico", -1, 10, 560, 560)
GUICtrlCreateLabel("User Mgr", 10, 600, 600)
$n11 = GUICtrlCreateIcon(@WindowsDir & "\cursors\appmgr.ico", -1, 10, 620, 620)
GUICtrlCreateLabel("App Mgr", 10, 660, 660)

GUISetState(@SW_SHOW)
Link to comment
Share on other sites

You can almost do it with the beta.

In fact the icon are not transparent today but label are if you disable the background image as stated in the doc

I will look to see if we can have the icon transparent too. :(

GUICtrlCreatePic(@desktopDir & "\background.jpg", 20, 20, 150, 700)
GuiCtrlSetState(-1,$GUI_DISABLE)

$n1 = GUICtrlCreateIcon(@ProgramFilesDir & "\autoIt3\Aut2exe\Icons\setup01.ico", -1, 10, 20)
GUICtrlCreateLabel("RDP", 10, 60, 60)
$n2 = GUICtrlCreateIcon(@ProgramFilesDir & "\autoIt3\Aut2exe\Icons\setup02.ico", -1, 10, 80)
GUICtrlCreateLabel("DelProf", 10, 120, 120)
$n3 = GUICtrlCreateIcon(@ProgramFilesDir & "\autoIt3\Aut2exe\Icons\setup03.ico", -1, 10, 140)
GUICtrlCreateLabel("Fpolicy", 10, 180,180)
$n4 = GUICtrlCreateIcon(@ProgramFilesDir & "\autoIt3\Aut2exe\Icons\setup04.ico", -1, 10, 200)
GUICtrlCreateLabel("Files", 10, 240, 240)
Link to comment
Share on other sites

I take it you mean the Beta of the next ver of Autoit ?

I stuck in the 'GuiCtrlSetState(-1,$GUI_DISABLE)' command in my script but it did not make any difference. I assume it worked fine with yours ?

It would be nice to have a homemade background but its not the end of the world.

I'll install the beta on a different PC and see if it makes a difference...

You can almost do it with the beta.

In fact the icon are not transparent today but label are if you disable the background image as stated in the doc

I will look to see if we can have the icon transparent too. :(

GUICtrlCreatePic(@desktopDir & "\background.jpg", 20, 20, 150, 700)
GuiCtrlSetState(-1,$GUI_DISABLE)

$n1 = GUICtrlCreateIcon(@ProgramFilesDir & "\autoIt3\Aut2exe\Icons\setup01.ico", -1, 10, 20)
GUICtrlCreateLabel("RDP", 10, 60, 60)
$n2 = GUICtrlCreateIcon(@ProgramFilesDir & "\autoIt3\Aut2exe\Icons\setup02.ico", -1, 10, 80)
GUICtrlCreateLabel("DelProf", 10, 120, 120)
$n3 = GUICtrlCreateIcon(@ProgramFilesDir & "\autoIt3\Aut2exe\Icons\setup03.ico", -1, 10, 140)
GUICtrlCreateLabel("Fpolicy", 10, 180,180)
$n4 = GUICtrlCreateIcon(@ProgramFilesDir & "\autoIt3\Aut2exe\Icons\setup04.ico", -1, 10, 200)
GUICtrlCreateLabel("Files", 10, 240, 240)

<{POST_SNAPBACK}>

Link to comment
Share on other sites

I thought if I made the graphic smaller and then moved it over to the right of the gui then it would just sit by the side but something strange has happened.

Look to the right of the 'RDP' label, the graphic is ok, but all the other labels - [ Delprof, Fpolicy, Reboot etc ] the graphic has broken up.

I'm really confused now - [ well it does not take me a great deal these days.... ]

Posted Image

Code as follows:

#include <GUIConstants.au3>

GUICreate(" Admin Bar ", 150, 700, 20, 20)

GUICtrlCreatePic(@WindowsDir & "\cursors\mattsadminbar1.jpg", 80, 10, 66, 659)

$n1 = GUICtrlCreateIcon(@WindowsDir & "\cursors\rdp.ico", -1, 10, 20, 20)
GUICtrlCreateLabel("RDP", 10, 60, 60)
$n2 = GUICtrlCreateIcon(@WindowsDir & "\cursors\delprof.ico", -1, 10, 80, 80)
GUICtrlCreateLabel("DelProf", 10, 120, 120)
$n3 = GUICtrlCreateIcon(@WindowsDir & "\cursors\fpolicy.ico", -1, 10, 140, 140)
GUICtrlCreateLabel("Fpolicy", 10, 180,180)
$n4 = GUICtrlCreateIcon(@WindowsDir & "\cursors\wexplore.ico", -1, 10, 200, 200)
GUICtrlCreateLabel("Files", 10, 240, 240)
$n5 = GUICtrlCreateIcon(@WindowsDir & "\cursors\reboot.ico", -1, 10, 260, 260)
GUICtrlCreateLabel("Reboot", 10, 300, 300)
$n6 = GUICtrlCreateIcon(@WindowsDir & "\cursors\Scd.ico", -1, 10, 320, 320)
GUICtrlCreateLabel("Srv CD", 10, 360, 360)
$n7 = GUICtrlCreateIcon(@WindowsDir & "\cursors\wupdate.ico", -1, 10, 380, 380)
GUICtrlCreateLabel("Win Upt", 10, 420, 420)
$n8 = GUICtrlCreateIcon(@WindowsDir & "\cursors\vnc.ico", -1, 10, 440, 440)
GUICtrlCreateLabel("VNC", 10, 480, 480)
$n9 = GUICtrlCreateIcon(@WindowsDir & "\cursors\appman.ico", -1, 10, 500, 500)
GUICtrlCreateLabel("Prism", 10, 540, 540)
$n10 = GUICtrlCreateIcon(@WindowsDir & "\cursors\userman.ico", -1, 10, 560, 560)
GUICtrlCreateLabel("User Mgr", 10, 600, 600)
$n11 = GUICtrlCreateIcon(@WindowsDir & "\cursors\appmgr.ico", -1, 10, 620, 620)
GUICtrlCreateLabel("App Mgr", 10, 660, 660)

GUISetState(@SW_SHOW)
Link to comment
Share on other sites

#include <GUIConstants.au3>

GUICreate(" Admin Bar ", 150, 700, 20, 20)

GUICtrlCreatePic(@WindowsDir & "\cursors\mattsadminbar1.jpg", 80, 10, 66, 659)
GuiCtrlSetState(-1,$GUI_DISABLE)

$n1 = GUICtrlCreateIcon(@WindowsDir & "\cursors\rdp.ico", -1, 10, 20)
GUICtrlCreateLabel("RDP", 10, 60, 60)
$n2 = GUICtrlCreateIcon(@WindowsDir & "\cursors\delprof.ico", -1, 10, 80)
GUICtrlCreateLabel("DelProf", 10, 120, 120)
$n3 = GUICtrlCreateIcon(@WindowsDir & "\cursors\fpolicy.ico", -1, 10, 140)
GUICtrlCreateLabel("Fpolicy", 10, 180,180)
$n4 = GUICtrlCreateIcon(@WindowsDir & "\cursors\wexplore.ico", -1, 10, 200)
GUICtrlCreateLabel("Files", 10, 240, 240)
$n5 = GUICtrlCreateIcon(@WindowsDir & "\cursors\reboot.ico", -1, 10, 260)
GUICtrlCreateLabel("Reboot", 10, 300, 300)
$n6 = GUICtrlCreateIcon(@WindowsDir & "\cursors\Scd.ico", -1, 10, 320)
GUICtrlCreateLabel("Srv CD", 10, 360, 360)
$n7 = GUICtrlCreateIcon(@WindowsDir & "\cursors\wupdate.ico", -1, 10, 380)
GUICtrlCreateLabel("Win Upt", 10, 420, 420)
$n8 = GUICtrlCreateIcon(@WindowsDir & "\cursors\vnc.ico", -1, 10, 440)
GUICtrlCreateLabel("VNC", 10, 480, 480)
$n9 = GUICtrlCreateIcon(@WindowsDir & "\cursors\appman.ico", -1, 10, 500)
GUICtrlCreateLabel("Prism", 10, 540, 540)
$n10 = GUICtrlCreateIcon(@WindowsDir & "\cursors\userman.ico", -1, 10, 560)
GUICtrlCreateLabel("User Mgr", 10, 600, 600)
$n11 = GUICtrlCreateIcon(@WindowsDir & "\cursors\appmgr.ico", -1, 10, 620)
GUICtrlCreateLabel("App Mgr", 10, 660)

GUISetState(@SW_SHOW)

WIth the latest beta this code should be ok

The $GUI_DISABLE is mandatory and you have an extra parameter in each GUICtrlCreateIcon

Link to comment
Share on other sites

Thanks JPM, I tried the latest beta but hit problems, the icons grew in size on a massive scale and the graphic still had the same problems. I have no idea why I am getting this problem. I have read threads on similar problems [ transparent icons, guis etc ] and people seem to fix this with the latest beta.

Its driving me nuts but as its only eye candy then so be it.

[ Its still driving me nuts though :lmao::lmao::lmao: ]

#include <GUIConstants.au3>

GUICreate(" Admin Bar ", 150, 700, 20, 20)

GUICtrlCreatePic(@WindowsDir & "\cursors\mattsadminbar1.jpg", 80, 10, 66, 659)
GuiCtrlSetState(-1,$GUI_DISABLE)

$n1 = GUICtrlCreateIcon(@WindowsDir & "\cursors\rdp.ico", -1, 10, 20)
GUICtrlCreateLabel("RDP", 10, 60, 60)
$n2 = GUICtrlCreateIcon(@WindowsDir & "\cursors\delprof.ico", -1, 10, 80)
GUICtrlCreateLabel("DelProf", 10, 120, 120)
$n3 = GUICtrlCreateIcon(@WindowsDir & "\cursors\fpolicy.ico", -1, 10, 140)
GUICtrlCreateLabel("Fpolicy", 10, 180,180)
$n4 = GUICtrlCreateIcon(@WindowsDir & "\cursors\wexplore.ico", -1, 10, 200)
GUICtrlCreateLabel("Files", 10, 240, 240)
$n5 = GUICtrlCreateIcon(@WindowsDir & "\cursors\reboot.ico", -1, 10, 260)
GUICtrlCreateLabel("Reboot", 10, 300, 300)
$n6 = GUICtrlCreateIcon(@WindowsDir & "\cursors\Scd.ico", -1, 10, 320)
GUICtrlCreateLabel("Srv CD", 10, 360, 360)
$n7 = GUICtrlCreateIcon(@WindowsDir & "\cursors\wupdate.ico", -1, 10, 380)
GUICtrlCreateLabel("Win Upt", 10, 420, 420)
$n8 = GUICtrlCreateIcon(@WindowsDir & "\cursors\vnc.ico", -1, 10, 440)
GUICtrlCreateLabel("VNC", 10, 480, 480)
$n9 = GUICtrlCreateIcon(@WindowsDir & "\cursors\appman.ico", -1, 10, 500)
GUICtrlCreateLabel("Prism", 10, 540, 540)
$n10 = GUICtrlCreateIcon(@WindowsDir & "\cursors\userman.ico", -1, 10, 560)
GUICtrlCreateLabel("User Mgr", 10, 600, 600)
$n11 = GUICtrlCreateIcon(@WindowsDir & "\cursors\appmgr.ico", -1, 10, 620)
GUICtrlCreateLabel("App Mgr", 10, 660)

GUISetState(@SW_SHOW)

WIth the latest beta this code should be ok

The $GUI_DISABLE is mandatory  and you have an extra parameter in each GUICtrlCreateIcon

<{POST_SNAPBACK}>

Link to comment
Share on other sites

I owe you a pint big time - thanks for pointing that out - took them out and it works great !!

Many many thanks. You have made me VERY happy.

:(:(::):P

did you suppress your extra parameter in the GUICtrlCreateIcon as I did in the code I propose

$n1 = GUICtrlCreateIcon(@WindowsDir & "\cursors\rdp.ico", -1, 10, 20, 20)

<{POST_SNAPBACK}>

Link to comment
Share on other sites

I owe you a pint big time - thanks for pointing that out - took them out and it works great !!

Many many thanks. You have made me VERY happy.

:(  :  :)  :P  ;)

<{POST_SNAPBACK}>

Next time read carefully the few word I am writing you could have find the solution before you drive nuts. :(
Link to comment
Share on other sites

I owe you a pint big time - thanks for pointing that out - took them out and it works great !!

Many many thanks. You have made me VERY happy.

:(  :(  :  :)  :P

<{POST_SNAPBACK}>

Finished the admin bar today, got more stuff to add and do etc - got a rough beta working:

Posted Image

Link to comment
Share on other sites

Look pretty nice be carefull with the size of image you insert. some as me are sometime behind a 56k line. You would not believe but it work slowly ...

<{POST_SNAPBACK}>

Well, at least it wasn't a BMP, as many here still seem to be using :(

Anyway, nice work Matt !!

Link to comment
Share on other sites

Well, at least it wasn't a BMP, as many here still seem to be using :(

Anyway, nice work Matt !!

<{POST_SNAPBACK}>

Thanks for the good feedback, its the first time I have made a GUI type app using Autoit, all my other stuff has been pure script for installing apps and running day to day tasks etc.

I have also moved over to Scite from Crimson, something I should have done ages ago. I did not realise just how feature packed Scite was !! The Guibuilder will make my life easier in the future as I did not realise it was there until I had finished creating the gui in the script !! DOH !!

Thanks again for the advice and help.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...