Sign in to follow this  
Followers 0
sak

BB Code Creater

2 posts in this topic

#1 ·  Posted (edited)

Easy Script for you. :)

#NoTrayIcon
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Opt("MustDeclareVars", 1)

main()
Func main()
    Local $hGUI, $Input_urlname, $Input_linkname, $Edit_bbcode, $Button_build
    Local $nMsg, $urlname, $linkname

    $hGUI = GUICreate("BB Code Creater", 332, 338, -1, -1)
    $Input_urlname = GUICtrlCreateInput("http://www.google.com", 16, 32, 300, 21)
    $Input_linkname = GUICtrlCreateInput("Click here", 16, 88, 297, 21)
    $Edit_bbcode = GUICtrlCreateEdit("", 16, 148, 297, 137, BitOR _
    ($ES_CENTER,$ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_READONLY,$WS_HSCROLL,$WS_VSCROLL))
    GUICtrlSetData(-1, StringFormat("\r\n\r\n\r\n\r\n\r\n\r\n"))
    GUICtrlCreateLabel("URL", 144, 15, 26, 17)
    GUICtrlCreateLabel("Link Name", 136, 71, 55, 17)
    GUICtrlCreateLabel("BB Code", 136, 129, 46, 17)
    $Button_build = GUICtrlCreateButton("Build Hiper Link", 16, 296, 299, 33, BitOR($BS_CENTER,$WS_GROUP))
    GUICtrlSetCursor(-1, 0)
    GUISetState(@SW_SHOW)

    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
        Case $GUI_EVENT_CLOSE
        Exit
            Case $Button_build
        $urlname = GUICtrlRead($Input_urlname)
        $linkname = GUICtrlRead($Input_linkname)
        If $urlname = '' Then
            MsgBox(0, "", "Enter URL", "", $hGUI)
            ContinueLoop
        ElseIf $linkname = '' Then
                    MsgBox(0, "", "Enter Link Name", "", $hGUI)
            ContinueLoop
                Else
            GUICtrlSetData($Edit_bbcode, StringFormat("\r\n\r\n\r\n\r\n[url=" & $urlname & "]" & $linkname & "[/url]"))
        EndIf
        EndSwitch
    WEnd
EndFunc
Edited by sak

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

lol, it works, :)

Keep up the good work

Edited by dufran3

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