Jump to content

GUI Related Questions.


Recommended Posts

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
Link to comment
Share on other sites

  • Moderators

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:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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? :)

Link to comment
Share on other sites

  • Moderators

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:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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? :)

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! :)

Link to comment
Share on other sites

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
Link to comment
Share on other sites

#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! :)

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...