Jump to content



Photo

GuiIPAddress UDF


  • Please log in to reply
14 replies to this topic

#1 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 06 February 2006 - 09:22 PM

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, 19 February 2006 - 12:57 PM.

SciTE for AutoItDirections for Submitting Standard UDFs

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






#2 theguy0000

theguy0000

    Benevolent Dictator

  • Active Members
  • PipPipPipPipPipPip
  • 3,750 posts

Posted 06 February 2006 - 10:05 PM

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

#3 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 06 February 2006 - 10:59 PM

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


#4 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 07 February 2006 - 01:06 AM

TODO features:
> set address function
> set range function

See 1st post for attachments.

SciTE for AutoItDirections for Submitting Standard UDFs

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


#5 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 07 February 2006 - 01:46 AM

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.


#6 Lazycat

Lazycat

    Coding cat

  • MVPs
  • 1,174 posts

Posted 07 February 2006 - 08:25 AM

Funny, I already make the same UDF :lmao: But yours can set styles, I forget about that in mine.
Koda homepage (http://www.autoitscript.com/fileman/users/lookfar/formdesign.html) (Bug Tracker)My Autoit script page (http://www.autoitscript.com/fileman/users/Lazycat/)

#7 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 07 February 2006 - 11:34 AM

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, 07 February 2006 - 11:51 AM.

SciTE for AutoItDirections for Submitting Standard UDFs

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


#8 Dirk Diggler

Dirk Diggler

    Wayfarer

  • Active Members
  • Pip
  • 69 posts

Posted 19 February 2006 - 11:13 AM

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, 19 February 2006 - 11:21 AM.


#9 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 19 February 2006 - 12:57 PM

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.


#10 DM2005

DM2005

    Seeker

  • New Members
  • 5 posts

Posted 04 March 2006 - 01:54 PM

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

#11 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 14 March 2006 - 01:32 PM

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.


#12 jefhal

jefhal

    Not The Appeaser

  • Active Members
  • PipPipPipPipPipPip
  • 708 posts

Posted 30 August 2006 - 01:17 AM

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

#13 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 30 August 2006 - 01:19 AM

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.


#14 jefhal

jefhal

    Not The Appeaser

  • Active Members
  • PipPipPipPipPipPip
  • 708 posts

Posted 30 August 2006 - 01:22 AM

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, 30 August 2006 - 01:33 AM.

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

#15 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 30 August 2006 - 01:33 AM

Extract the following, and try the examples, it's what I've submitted.

Gary

SciTE for AutoItDirections for Submitting Standard UDFs

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





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users