Sign in to follow this  
Followers 0
Ysengrim

How draw a line in a box? & How set 2 commands on 1 line?

9 posts in this topic

question 1

The only thing I could find to draw a line for visual separating things in a box is this :

GUICtrlCreateLabel("_________________________________________________",0,250)

GUICtrlSetState(-1,$GUI_DISABLE)

Is there a more professional solution to do so ?

question 2

sometimes a few short commands follow eachother , is there a separator to set those commands on one line?

So the script is not getting to long to scroll down

example of 2 short commands

sleep(1000)

beep(1000,200)

thanks

Ysengrim

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

question 2

sometimes a few short commands follow eachother , is there a separator to set those commands on one line?

So the script is not getting to long to scroll down

example of 2 short commands

sleep(1000)

beep(1000,200)

thanks

Ysengrim

It's called @CRLF

This topic has been discussed before. See this link

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

question 1

The only thing I could find to draw a line for visual separating things in a box is this :

GUICtrlCreateLabel("_________________________________________________",0,250)

GUICtrlSetState(-1,$GUI_DISABLE)

Is there a more professional solution to do so ?

Not necessarily a "professional" solution, but here's what I've resorted to doing:

#include <GUIConstants.au3>

GUICreate("My GUI",500,100)
GUICtrlCreateLabel("Example of how I use a Groupbox as a separator",0,20,500,50, $SS_CENTER)
$separator1 = GUICtrlCreateGroup("", 25, 40, 450, 8)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateLabel("since I couldn't find a suitable alternative method to create one.",0,60,500,50, $SS_CENTER)

GUISetState (@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Share this post


Link to post
Share on other sites

It's called @CRLF

This topic has been discussed before. See this link

i didn't found it on your link

and the CRLF function does not work in he script itselfs

i gues i didn't make myserf clear

i want a few commands be placed on 1 line in the script not on the screen

example if i want to declare a few variables like i do

$Lenght="200"

$Width="250"

and i want them in the sript on one line

$Lenght="200" ? $Width="250"

what do i have to put in between so the script is seeing it like 2 lines?

Share this post


Link to post
Share on other sites

$Lenght="200" , $Width="250"

??? i dont understand either


There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

1) for drawing separators, see GUICtrlCreateGraphic() and GUICtrlSetGraphic()

2) that depends. You can define variables in one line separated by commas, if you specify scope. Such as,

Global $Lenght=200, $Width=250

You can have several commands in one line if one of them takes the return value of another as one of its parameters. Such as,

$aLines = StringSplit(StringStripCR(FileRead("file.txt")), @LF)

Overall, you would do yourself and everyone else a favour by taking time to examine the help file, it has a lot of interesting things in it. <_<

Edited by Siao

"be smart, drink your wine"

Share this post


Link to post
Share on other sites

i didn't found it on your link

and the CRLF function does not work in he script itselfs

Then you obviously missed the joke.

Let me spell it out for you in plain english, then.

There IS no way to combine commands to make a "one-line-program" or whatnot.


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

For a visual separator though you can try this (I use it a bunch)

#include <StaticConstants.au3>

$gui = GUICreate('', 200, 200)
; Horizontal line
GUICtrlCreateLabel('', 0, 50, 200, 2, $SS_SUNKEN)
; Vertical line
GUICtrlCreateLabel('', 99, 50, 2, 150, $SS_SUNKEN)

GUISetState()

While 1
    $gm = GUIGetMsg()
    Switch $gm
        Case -3
            ExitLoop
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites

Saunders thanks for your effort !!!

It was just what I was looking for

Share this post


Link to post
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
Sign in to follow this  
Followers 0