Jump to content

Recommended Posts

Posted (edited)

Hello!

I have this idea in my head where i want to create a awesome looking GUI but the 2 best ideas i have, seem to me to be impossible to create in autoit, or at least im unable to find anything about how to create them. I normally use KODA to make GUI's in, and it seems that you can't create what im looking for in there.

But now to the point!

I would like to create a circle GUI, where the GUI itself is a circle and with some text and maybe a inputbox inside it.

Example (Created fast in paint) 2kio8p.jpg

My other idea is a standard GUI but with Tabs as i would call them, im un sure what the "real" name of these "Tabs" are.

Example (Created fast in paint)scyyv6.jpg

So if you have an idea how to create one of these im very interested in how to create them! :)

Edited by GraaF1337
  • Moderators
Posted

GraaF1337,

There are numerous examples of how to create "shaped" GUIs on the forum. :)

As to the tabs - they are called (unsurprisingly) "Tabs" and a quick glance at the Help file will show you many functions that you can use to produce them - GUICtrlCreateTab would be a good place to start. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

  On 3/3/2014 at 1:08 PM, Melba23 said:

GraaF1337,

There are numerous examples of how to create "shaped" GUIs on the forum. :)

As to the tabs - they are called (unsurprisingly) "Tabs" and a quick glance at the Help file will show you many functions that you can use to produce them - GUICtrlCreateTab would be a good place to start. ;)

M23

The only thread i could find about creating "shaped" GUI is rounded corners?

And about the tabs thanks for your help, but is it possible to do in KODA or do you need to do it by hand? :)

  • Moderators
Posted

GraaF1337,

I have never used Koda, so I have no idea if you can add tabs when using it. But they are not difficult to code "by hand" - and you could always use Koda to arrange the controls for each tab separately and then combine the resulting code sections into a final script. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

  On 3/3/2014 at 1:21 PM, FireFox said:

You can create shaped GUI using a PNG and the transparent part of the PNG can be used as corners.

Can you give me an example of that please? :)

  On 3/3/2014 at 1:25 PM, Melba23 said:

GraaF1337,

I have never used Koda, so I have no idea if you can add tabs when using it. But they are not difficult to code "by hand" - and you could always use Koda to arrange the controls for each tab separately and then combine the resulting code sections into a final script. :)

M23

Ohhh okay and thanks alot! :)

Posted (edited)
  On 3/3/2014 at 1:49 PM, GraaF1337 said:

Can you give me an example of that please? :)

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <WinAPISys.au3>

InetGet("http://i.imgur.com/RfLGeSn.png", "RfLGeSn.png")

_GDIPlus_Startup()
Local $hImage = _GDIPlus_ImageLoadFromFile("RfLGeSn.png")
Local $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown()

FileDelete("RfLGeSn.png")

Local $tSize = _WinAPI_GetBitmapDimension($hHBitmap)

Local $iWidth = DllStructGetData($tSize, 1)
Local $iHeight = DllStructGetData($tSize, 2)

Local $hGUI = GUICreate("MyGUI", $iWidth, $iHeight, -1, -1, $WS_POPUP, $WS_EX_LAYERED)

Local $aPos = WinGetPos($hGUI)

Local $hLayGUI = GUICreate("", 70, 23, $aPos[0] + ($aPos[2] - 70) / 2, $aPos[1] + $aPos[3] - 50, $WS_POPUP, $WS_EX_LAYERED, $hGUI)
GUISetBkColor(0x2B5280, $hLayGUI)
Local $iButton1 = GUICtrlCreateButton("Button1", 0, 0, 70, 23)
GUICtrlSetState($iButton1, $GUI_FOCUS)

_WinAPI_SetLayeredWindowAttributes($hLayGUI, 0x2B5280, 0, $LWA_COLORKEY)
_WinAPI_UpdateLayeredWindowEx($hGUI, -1, -1, $hHBitmap)

GUISetState(@SW_SHOW, $hGUI)
GUISetState(@SW_SHOW, $hLayGUI)

Local $iMsg = 0

While 1
    $iMsg = GUIGetMsg()
    Switch $iMsg
        Case $GUI_EVENT_CLOSE, $iButton1
            ExitLoop
    EndSwitch
WEnd

GUIDelete($hLayGUI)
GUIDelete($hGUI)
Edited by FireFox
Posted
  On 3/3/2014 at 2:07 PM, FireFox said:
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <WinAPISys.au3>

InetGet("http://i.imgur.com/RfLGeSn.png", "RfLGeSn.png")

_GDIPlus_Startup()
Local $hImage = _GDIPlus_ImageLoadFromFile("RfLGeSn.png")
Local $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown()

FileDelete("RfLGeSn.png")

Local $tSize = _WinAPI_GetBitmapDimension($hHBitmap)

Local $iWidth = DllStructGetData($tSize, 1)
Local $iHeight = DllStructGetData($tSize, 2)

Local $hGUI = GUICreate("MyGUI", $iWidth, $iHeight, -1, -1, $WS_POPUP, $WS_EX_LAYERED)

Local $aPos = WinGetPos($hGUI)

Local $hLayGUI = GUICreate("", 70, 23, $aPos[0] + ($aPos[2] - 70) / 2, $aPos[1] + $aPos[3] - 50, $WS_POPUP, $WS_EX_LAYERED, $hGUI)
GUISetBkColor(0x2B5280, $hLayGUI)
Local $iButton1 = GUICtrlCreateButton("Button1", 0, 0, 70, 23)
GUICtrlSetState($iButton1, $GUI_FOCUS)

_WinAPI_SetLayeredWindowAttributes($hLayGUI, 0x2B5280, 0, $LWA_COLORKEY)
_WinAPI_UpdateLayeredWindowEx($hGUI, -1, -1, $hHBitmap)

GUISetState(@SW_SHOW, $hGUI)
GUISetState(@SW_SHOW, $hLayGUI)

Local $iMsg = 0

While 1
    $iMsg = GUIGetMsg()
    Switch $iMsg
        Case $GUI_EVENT_CLOSE, $iButton1
            ExitLoop
    EndSwitch
WEnd

GUIDelete($hLayGUI)
GUIDelete($hGUI)

Thank you! :)

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
  • Recently Browsing   0 members

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