Sign in to follow this  
Followers 0
GaryFrost

GuiIPAddress UDF

15 posts in this topic

#1 ·  Posted (edited)

Requires beta

http://www.autoitscript.com/fileman/users/gafrost/ipaddress.GIF

TODO features:

> set address function

> set range function

Fixed: _GetIPAdress function, used code from LazyCat's control

This was more for a learning experience.

Edit: added ability to use styles and extended styles

Functions:

; create the control

_GuiCtrlIpAddressCreate($h_Gui, $x, $y, $width, $heigth, $v_styles = -1, $v_exstyles = -1)

; Clears the contents of the IP address control.

_ClearIPAdress($h_IPAdress)

; Retrieves the address values for all four fields in the IP address control.

_GetIPAdress($h_IPAdress)

; Determines if all fields in the IP address control are blank.

_IPIsBlank($h_IPAdress)

; Sets the keyboard focus to the specified field in the IP address control.

; All of the text in that field will be selected.

_IPSetFocus($h_IPAdress, $index)

; Sets the valid range for the specified field in the IP address control.

_IPSetRange($h_IPAdress, $field_index, $low_range = 0, $high_range = 255)

; Sets the address values for all four fields in the IP address control.

; i.e. "24.2.255.2"

_IPSetAddress($h_IPAdress, $s_address)

Enjoy

Edit: some refinements to _GetIPAdress and _IPSetRange functions

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites



... :lmao:

so..what does it do..


The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

... :lmao:

so..what does it do..

It's a SysIPAdress32 control, so don't have to do all the checking to see if each field is > 255 because it won't let you.

Just thru it together for anyone wanting add an IP control to an script, think holger or someone did an IP Control dll a while back.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Sorry was going to add this in the previous post but forgot to

added ability to use styles and extended styles


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Funny, I already make the same UDF :lmao: But yours can set styles, I forget about that in mine.

I knew someone had done an dll, didn't know it had been done as a UDF already

Made some refinements to _GetIPAdress and _IPSetRange functions

Thanks.

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

if first octet is above 200, script have a little trouble. I can't enter, f.e. my DNS-server IP: 213.24.93.1

Edited by Dirk Diggler

Share this post


Link to post
Share on other sites

if first octet is above 200, script have a little trouble. I can't enter, f.e. my DNS-server IP: 213.24.93.1

Fixed it, see 1st post


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Hi!

Is it possible to disable the input field? I tried it with "GUICtrlSetState($variable, $GUI_DISABLE), but it don't work.

Can anyone help me?

Thanks, Dennis

Share this post


Link to post
Share on other sites

Hi!

Is it possible to disable the input field? I tried it with "GUICtrlSetState($variable, $GUI_DISABLE), but it don't work.

Can anyone help me?

Thanks, Dennis

Sorry for the delay, was out of town

put the following just before the while line in the example to see how it works

ControlDisable("IP Address Control Example", "", "Edit1")
 ControlDisable("IP Address Control Example", "", "Edit2")
 ControlDisable("IP Address Control Example", "", "Edit3")
 ControlDisable("IP Address Control Example", "", "Edit4")

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Trying to run it with the latest beta, but I get this:

C:\Program Files\AutoIt3\Examples\IPAdress_Example.au3 - 1 error(s), 0 warning(s)

!>AU3Check ended.rc:2

>Running:(3.2.1.1):C:\Program Files\AutoIt3\beta\autoit3.exe "C:\Program Files\AutoIt3\Examples\IPAdress_Example.au3"

C:\Program Files\AutoIt3\Examples\GuiIPAdress.au3 (4) : ==> Can not redeclare a constant.:

Global Const $WM_USER = 0x400

Global Const ^ ERROR

+>AutoIT3.exe ended.rc:0

>Exit code: 0 Time: 7.306


...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites

Trying to run it with the latest beta, but I get this:

Just comment that line out, that example was written before the includes were split


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Just comment that line out, that example was written before the includes were split

That allowed it to run. Then ran into problem trying to input 172.20.xx.xx. Hits snag on the second octet...

Changed values in lines 35 and 37 and it works with 172.20.etc., but am too stupid to understand what I would use this for. My apologies... :P

Edited by jefhal

...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

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