AutoHotkey Community

It is currently May 27th, 2012, 3:06 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Fancy Font Generator
PostPosted: March 20th, 2010, 10:05 am 
Offline

Joined: March 20th, 2010, 9:49 am
Posts: 224
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 20th, 2010, 7:14 pm 
Offline

Joined: April 8th, 2009, 8:23 pm
Posts: 3036
Location: Rio de Janeiro - RJ - Brasil
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.
"
Image
Antonio França
My stuff: Google Profile


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 21st, 2010, 1:24 pm 
Offline

Joined: March 20th, 2010, 9:49 am
Posts: 224
thx a million ! master focus :wink:

actually i am really new to AHK


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot], rbrtryn, Yahoo [Bot] and 29 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group