Mcky Posted June 10, 2005 Share Posted June 10, 2005 I created this in less than an hour. It has a few lines of code to use it in your scripts/compiled scripts. Allows skinning of the GUI using bitmaps. Features: :Using bitmap images to customize how the window look like :Can add more buttons(help,etc) :Auto lock to edge of screen so window can't move beyond the screen Problems: :Cannot use rounded corners(like XP's luna interface) :When minimize and restores,buttons are lost. Just hover the cursor on them to restore them back. :a bit untidy code. Give it a try and i will improve it in due time. Thanks. My website: (Lots of AutoIt compiled programs+GameMaker games)http://mcky.sitesled.comMy AutoIt projects:Mcky's CalEntry - Calendar schedulingMcky's Web Extractor - Web page links extractorMcky's Appkey- Powerful Hotkey-listing tool[quote]I wish I was never born. I am just a lonely soul in this world... :([/quote] Link to comment Share on other sites More sharing options...
buzz44 Posted June 10, 2005 Share Posted June 10, 2005 (edited) Very Nice. There have been some other GUI skinning but I think this is the best one .To solve the problem about the buttons disappearing simply swap the order in which you create the items and use a style. This works fine ...#include <GUIConstants.au3> $main_gui=GUICreate ("Your App",320,200,-1,-1,$WS_POPUPWINDOW) ;"Your App" defines the title of the GUI form. $menubar=GUICtrlCreatePic ("menu_bar.bmp",0,0,320,24, 0x00000020) $button_close=GUICtrlCreateButton("",290,0,24,24,0x0080) GUICtrlSetImage ($button_close,"menu_close.bmp") $button_min=GUICtrlCreateButton("",260,0,24,24,0x0080) GUICtrlSetImage ($button_min,"menu_min.bmp") GUICtrlCreatePic ("menu_down.bmp",0,195,320,5) GUICtrlCreatePic ("menu_sides.bmp",0,24,4,200) GUICtrlCreatePic ("menu_sides.bmp",316,24,4,200) GUICtrlSetTip ($button_close,"Closes the application") GUICtrlSetTip ($button_min,"Minimizes the application") GUICtrlSetTip ($menubar,"Hold the primary mouse button to drag the window.") GUISetState(@SW_SHOW)And every thing else is the same. I moved the GUISetState() and changed the style for $menubar=GUICtrlCreatePic ("menu_bar.bmp",0,0,320,24, 0x00000020)Hint: When creating things that over lap such as having a background for your GUI start with what will be on the bottom first, then whats on top of that, and then whats on top of that etc. And you should always call GUISetState() after you have created/altered all your controls.Edit: Also what program did you use to create the support pictures and I think you need to do some work for the window moving.Edit 2: Ok I fixed the window moving by using a funciton created by SlimShady. I also fixed the indentations and changed the order of creating the controls a little bit. Edited June 10, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
Mcky Posted June 10, 2005 Author Share Posted June 10, 2005 (edited) Burrup: Thanks,burrup! The GUI is much more stable now! I used MS-Paint to create the Bitmaps. I will add more features in due time. Thanks again. Note: If you want to use the source in your scripts,please download the first post's ZIP file for the skin bitmaps and burrup's modified basic_skin.au3. Plans: To add rounded corners (if at all possible) Transparency setting (in 2K/XP) Better looking 3D-like skins Dynamically resizing GUI form Edited June 10, 2005 by Mcky My website: (Lots of AutoIt compiled programs+GameMaker games)http://mcky.sitesled.comMy AutoIt projects:Mcky's CalEntry - Calendar schedulingMcky's Web Extractor - Web page links extractorMcky's Appkey- Powerful Hotkey-listing tool[quote]I wish I was never born. I am just a lonely soul in this world... :([/quote] Link to comment Share on other sites More sharing options...
Mcky Posted June 11, 2005 Author Share Posted June 11, 2005 (edited) Here is a new skins pack. See the screenshot: Includes modified script by Burrup Edited June 11, 2005 by Mcky My website: (Lots of AutoIt compiled programs+GameMaker games)http://mcky.sitesled.comMy AutoIt projects:Mcky's CalEntry - Calendar schedulingMcky's Web Extractor - Web page links extractorMcky's Appkey- Powerful Hotkey-listing tool[quote]I wish I was never born. I am just a lonely soul in this world... :([/quote] Link to comment Share on other sites More sharing options...
buzz44 Posted June 11, 2005 Share Posted June 11, 2005 Nice. I'm working on a little skinning idea as well mostly using Adobe PhotoShop CS, ImageReady CS and PhotoShop Elements because you can create real nice images with them. qq Link to comment Share on other sites More sharing options...
GaryFrost Posted June 13, 2005 Share Posted June 13, 2005 Might want to look at http://www.autoitscript.com/forum/index.php?showtopic=12449 for rounded corners SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
eJan Posted June 17, 2005 Share Posted June 17, 2005 (edited) Try this one (I couldn't get screenshoot): EDIT: updatedTransparent_GUI.rar Edited June 18, 2005 by eJan Link to comment Share on other sites More sharing options...
layer Posted June 17, 2005 Share Posted June 17, 2005 Wow guys, keep it up!!! These look very nice FootbaG Link to comment Share on other sites More sharing options...
Lazycat Posted June 20, 2005 Share Posted June 20, 2005 Try this one (I couldn't get screenshoot):Wow! Though I dislike skins, this example is looks impressive! Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
buzz44 Posted June 20, 2005 Share Posted June 20, 2005 (edited) They can be a hassle to implement lol, currently I'm trying to work with the new window shape functions gafrost provided and using transparent gif's. But it gets a bit hard with a transparent picture because of child windows etc etc. Edited June 20, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
hgeras Posted August 28, 2005 Share Posted August 28, 2005 I see that u have forgotten to use an extended style in your skin script. In basic_skin.au3 if you use : $menubar=GUICtrlCreatePic ("menu_bar.bmp",0,0,320,24,-1,$GUI_WS_EX_PARENTDRAG) instead of : $menubar=GUICtrlCreatePic ("menu_bar.bmp",0,0,320,24) Then you will have a smooth window movement and without having to play with MouseGetCursor(). expandcollapse popup$main_gui=GUICreate ("Your App",320,200,-1,-1,$WS_POPUPWINDOW) ;"Your App" defines the title of the GUI form. GUISetState(@SW_SHOW) $button_close=GUICtrlCreateButton("",290,0,24,24,0x0080) GUICtrlSetImage ($button_close,"menu_close.bmp") $button_min=GUICtrlCreateButton("",260,0,24,24,0x0080) GUICtrlSetImage ($button_min,"menu_min.bmp") $menubar=GUICtrlCreatePic ("menu_bar.bmp",0,0,320,24,-1,$GUI_WS_EX_PARENTDRAG) GUICtrlCreatePic ("menu_down.bmp",0,195,320,5) GUICtrlCreatePic ("menu_sides.bmp",0,24,4,200) GUICtrlCreatePic ("menu_sides.bmp",316,24,4,200) GUICtrlSetTip ($button_close,"Closes the application") GUICtrlSetTip ($button_min,"Minimizes the application") GUICtrlSetTip ($menubar,"Hold the primary mouse button to drag the window.") While 1 $msg = GUIGetMsg() If $msg=$button_close Then Exit If $msg=$button_min Then WinSetState("Your App","",@SW_MINIMIZE) ;~ $mouse_data=GUIGetCursorInfo ($main_gui) ;~ If $mouse_data[2]=1 AND $mouse_data[4]=$menubar Then GUI_POS() Wend ;~ Func GUI_POS() ;~ While 1 ;~ $mouse_data=GUIGetCursorInfo ($main_gui) ;~ If $mouse_data[2]=0 Then ;~ $mpos=MouseGetPos ( ) ;~ ExitLoop ;~ EndIf ;~ Wend ;~;these two values:320 and 200,corresponds to the size of GUI form. Change according to the size of your GUI. ;~ If $mpos[0]>@DesktopWidth-320 Then $mpos[0]=@DesktopWidth-320 ;~ If $mpos[1]>@DesktopHeight-200 Then $mpos[1]=@DesktopHeight-200 ;~ WinMove ("Your App","",$mpos[0],$mpos[1]) ;~ EndFunc C ya Useful information about COM/Objects referenceMy Scripts:PapDefragNvidia Temperature Logger V3.0 with graph analyzerAutoiIt Update Checker And Downloader V1.0ArrayPush UDF 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