Jump to content

Separator in GUI possible?


Allow2010
 Share

Recommended Posts

I think those things are easier to make with labels, and then you don't need to worry about refreshing the screen to redraw the lines.

$gui = GUICreate("separators")
$rad1 = GUICtrlCreateRadio("one", 20, 20)
$rad2 = GUICtrlCreateRadio("two", 20, 40)
$rad3 = GUICtrlCreateRadio("three", 20, 60)
$rad4 = GUICtrlCreateRadio("four", 20, 80)

addVerticalSeparator(80, 20, 80)



GUISetState()
While 1
    If GUIGetMsg() = -3 Then Exit

WEnd

Func addVerticalSeparator($x, $y, $h)
    GUICtrlCreateLabel("", $x, $y, 1, $h)
    GUICtrlSetBkColor(-1, 0x999999)
    GUICtrlCreateLabel("", $x + 1, $y, 2, 1)
    GUICtrlSetBkColor(-1, 0x999999)
    GUICtrlCreateLabel("", $x + 1, $y + 1, 2, $h)
    GUICtrlSetBkColor(-1, 0xffffff)

EndFunc   ;==>addVerticalSeparator
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Label is the easiest way. It seems to me I recall using either a 2 or 3 px wide label the few times I've done it.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Func addVerticalSeparator($x, $y, $h)
    GUICtrlCreateLabel("", $x, $y, 1, $h)
    GUICtrlSetBkColor(-1, 0x999999)
    GUICtrlCreateLabel("", $x + 1, $y, 2, 1)
    GUICtrlSetBkColor(-1, 0x999999)
    GUICtrlCreateLabel("", $x + 1, $y + 1, 2, $h)
    GUICtrlSetBkColor(-1, 0xffffff)
EndFunc   ;==>addVerticalSeparator

Hmm...is it possible to do this in a vertival version too?

Link to comment
Share on other sites

  • Moderators

Allow2010,

I do it this way: :)

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>

$hGUI = GUICreate("Test", 500, 500)

_AddVertSep(10, 10, 100)

_AddHorzSep(10, 200, 200)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

WEnd


Func _AddVertSep($iX, $iY, $iH)

    GUICtrlCreateLabel("", $iX, $iY, 1, $iH)
    GUICtrlSetBkColor(-1, 0x000000)

EndFunc   ;==>addVerticalSeparator

Func _AddHorzSep($iX, $iY, $iW)

    GUICtrlCreateLabel("", $iX, $iY, $iW, 1)
    GUICtrlSetBkColor(-1, 0x000000)


EndFunc

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

..

Hmm...is it possible to do this in a vertival version too?

That is vertical, I suppose you mean horizontal?

It's just three labels as you can see. Two would possibly be enough but I added the small one across the top to make it look like the example in the first post.

You simply need to make horizontal labels for a horizontal separator. The only thing you can't do with labels is diagonal lines. (Well I think MrCreatoR made an example for diagonal lines on the screen using hundreds of tiny windows so you could do that with labels.)

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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...