Sign in to follow this  
Followers 0
monoscout999

Tiny operation Tool (Good for redesign GUIs)

3 posts in this topic

This is an usefull tool when you want to move controls in your in-process GUI, and you have to change a lot of numbers in the script

Just Configure the operation you desire, select a number and press F2 and the number will be replaced.

#include <windowsconstants.au3>
#include <EditConstants.au3>
HotKeySet("{F2}", "_Substitute")
HotKeySet("{ESC}", "_exit")
GUICreate("Clip Substitute by monoscout999", 200, 105)
$r1 = GUICtrlCreateRadio("Add", 5, 5, 80, 20)
GUICtrlSetState(-1, 1)
$r2 = GUICtrlCreateRadio("Subtract", 5, 30, 80, 20)
$r3 = GUICtrlCreateRadio("Multiply", 105, 5, 80, 20)
$r4 = GUICtrlCreateRadio("Divide", 105, 30, 80, 20)
$Input = GUICtrlCreateInput("", 5, 55, 190, 20, $ES_NUMBER)
$r5 = GUICtrlCreateRadio("Replace", 5, 80, 80, 20)
GUISetState()
Do
Until GUIGetMsg() = -3
Func _exit()
Exit
EndFunc   ;==>_exit
Func _Substitute()
Local $OldClip = ClipGet()
Send("^c")
Local $InputRead = Number(GUICtrlRead($Input))
Local $Number = Number(ClipGet())
Select
  Case GUICtrlRead($r1) = 1
   Local $Result = $Number + $InputRead
  Case GUICtrlRead($r2) = 1
   Local $Result = $Number - $InputRead
  Case GUICtrlRead($r3) = 1
   Local $Result = $Number * $InputRead
  Case GUICtrlRead($r4) = 1
   Local $Result = $Number / $InputRead
  Case GUICtrlRead($r5) = 1
   Local $Result = $InputRead
EndSelect
ClipPut($Result)
Send("^v")
ClipPut($OldClip)
EndFunc   ;==>_Substitute

Share this post


Link to post
Share on other sites



I like this!!! Thanks for the idea!

Share this post


Link to post
Share on other sites

Just a snnipet this can be inproved

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