 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
XYZ
Joined: 20 Mar 2010 Posts: 224
|
Posted: Sat Mar 20, 2010 9:05 am Post subject: Fancy Font Generator |
|
|
i am making a Fancy Font Generator
it has two edit boxes : ed1 and ed2
it works like this that when i enter abc in the first editbox (ed1) , the second edit box automatically returns @ß©
i tried to write a function using StringReplace and RegexReplace but didnt succeed because the variables got mixed up and only the last character , that is, © was changed
here's the basic code=needs IMPROVEMENT
it has lots of irrelevant lines....
| Code: |
Gui, Add, Edit, r9 gUpdate vMyEdit, Text to appear inside the edit control (omit this parameter to start off
Gui, Add, Edit, r9 vMyEdit2, Text to appear inside the edit control (omit this parameter to start off empty).
gui, show,, Fancy Font Generator
gui, submit, nohide
;setTimer, Fontgen, 200
Fontgen:
gui, submit, nohide
if (MyEdit = "a")
{
GuiControl, ,MyEdit2, @
Return
}
else if (MyEdit = "b")
{
GuiControl, ,MyEdit2, ß
return
}
else if (MyEdit = "c")
{
GuiControl, ,MyEdit2, ©
return
}
else
{
GuiControl, ,MyEdit2, %MyEdit%
return
}
Update:
gui, submit, nohide
NewStr:=RegExReplace(MyEdit, "a", "@")
GuiControl,, MyEdit2, %NewStr%
gui, submit, nohide
NewStr:=RegExReplace(MyEdit, "b", "B")
GuiControl,, MyEdit2, %NewStr%
;StringReplace, a1, MyEdit,a,@, All
;gui, submit, nohide
;GuiControl,, MyEdit2, %a1%
;StringReplace, b1, MyEdit,b,ß, All
;gui, submit, nohide
;GuiControl,, MyEdit2, %b1%
;StringReplace, MyEdit2, MyEdit,b,ß, All
;GuiControl,, MyEdit2, %MyEdit2%
;StringReplace, MyEdit2, MyEdit,c,©, All
;GuiControl,, MyEdit2, %MyEdit2%
;StringReplace, MyEdit2, MyEdit,d,d, All
;GuiControl,, MyEdit2, %MyEdit2%
return
GuiClose:
ExitApp |
|
|
| Back to top |
|
 |
MasterFocus
Joined: 08 Apr 2009 Posts: 3035 Location: Rio de Janeiro - RJ - Brasil
|
Posted: Sat Mar 20, 2010 6:14 pm Post subject: |
|
|
| Code: | Gui, Add, Edit, w400 r9 gUpdate vMyEdit, TYPE HERE
Gui, Add, Edit, w400 r9 vMyEdit2, NEW TEXT HERE
Gui, Show,, Fancy Font Generator
Return
Update:
Gui, Submit, NoHide
StringReplace, MyEdit2, MyEdit, a, @, All
StringReplace, MyEdit2, MyEdit2, b, ß, All
StringReplace, MyEdit2, MyEdit2, c, ©, All
GuiControl,, MyEdit2, %MyEdit2%
Return
GuiClose:
GuiEscape:
ExitApp |
 _________________ "Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried."
Antonio França
My stuff: Google Profile |
|
| Back to top |
|
 |
XYZ
Joined: 20 Mar 2010 Posts: 224
|
Posted: Sun Mar 21, 2010 12:24 pm Post subject: |
|
|
thx a million ! master focus
actually i am really new to AHK |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|