Sign in to follow this  
Followers 0
ludocus

My beginning of site builder

3 posts in this topic

I started this website builder:

#include <GUIConstants.au3>
#include <Misc.au3>
#include <File.au3>
HotKeySet ( '{ESC}', 'stop' )
$color = 0xFFFFFF
$cl = '#FFFFFF'
$title= 'Htlm Build Site'
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("HtmlBuilder", @DeskTopWidth, @DeskTOpHeight-60, 0, 0)
$List = GUICtrlCreateEdit ( '', 0, 0, @DeskTopWidth-3, @DeskTopHeight-60 )
GUICtrlSetBkColor ( $List, $color )
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$menu = GUICtrlCreateMenu ( 'Control' )
$menuC = GUICtrlCreateMenuItem ( 'Set Background Color', $menu )
$menuE = GUICtrlCreateMenuItem ( 'Export to file', $menu )
$menuL = GUICtrlCreateMenuItem ( 'Set the title', $menu )
$menuP = GUICtrlCreateMenuItem ( 'Exit', $menu )
GUICtrlSetTip ( $List, 'Put your website text here!')
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            exit
            
        Case $menuC
            $color =_ChooseColor (2)
            $cl = hex ( $color, 6 )
            if $color = -1 then
            else
            GUICtrlSetBkColor ( $List, $color )
        EndIf
        
    Case $menuP
        exit
        
    Case $menuL
        $titel = inputbox ( 'HtmlBuilder Set title', 'Please write down a new title:','','',-1, -1 )
        if not @error then $title = 'Nothing'
        
    Case $menuE
        $read = GUICtrlRead ( $List )
        $convert = StringReplace ( $read, @CRLF, '<BR>' )
        $new = '<HTML>'&@CRLF& _
        '<HEAD>'&@CRLF& _
        '<TITLE>'&$title&'</TITLE>'&@CRLF& _
        '</HEAD>'&@CRLF& _
        '<BODY bgcolor="'&$cl&'">'&@CRLF& _
        $convert&@CRLF& _
        '</BODY>'&@CRLF& _
        '</HTML>'
        $save = FileSaveDialog ( 'Save your file: ','', 'HTML Files (.html)' )
        if @error = 1 then
        Else
            _FileCreate ( $save&'.html')
            _FileWriteToLine  ( $save&'.html', 1, $new&'', 1 )
        EndIf
        
        

    EndSwitch
WEnd

Func stop()
    Exit
EndFunc

Please comment, Thnx :D

Share this post


Link to post
Share on other sites



It runs alright. This is very basic, so it has a long way to go, but keep at it! You'll definitely want to add a toolbar to make adding elements easier.

Share this post


Link to post
Share on other sites

thnx ur right

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