ludocus Posted April 15, 2008 Share Posted April 15, 2008 I started this website builder: expandcollapse popup#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 Link to comment Share on other sites More sharing options...
joshtp Posted April 15, 2008 Share Posted April 15, 2008 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. Link to comment Share on other sites More sharing options...
ludocus Posted April 15, 2008 Author Share Posted April 15, 2008 thnx ur right Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now