Jump to content

html code in output .


Recommended Posts

GuiWrite($edit_1, -1, "<a href="http://www.google.com">code</a>"& @CRLF & "")

So how can I do html code like that ? If I do it now it gives errors .

GuiWrite($edit_1, -1, '<a href="http://www.google.com">code</a>' & @CRLF)
Link to comment
Share on other sites

I added it but it does not seem to work ?

Opt("GUINotifyMode", 1)
GuiCreate("MyGUI", 718,485,10,10,0x04CF0000)

$edit_1 = GUISetControl("edit", '<html><head>   <meta http-equiv="content-type"content="text/html; charset=ISO-8859-1"><title></title>' & @CRLF, 10,10, 540,470)
$button_1 = GUISetControl("button", "Save", 580, 440, 80, 20)
$combo_1 = GUISetControl("combo", "Combo 1", 580,50, 120,40)
GuiSetControlData($combo_1, "background color|hyperlink|Aligns a paragraph|bold text|italic text|size of font|Body end")

GuiShow()

While 1
sleep(100)
$msg = GuiMsg(0)

Select
Case $msg = -3
ExitLoop
Case $msg = $edit_1
;;;
Case $msg = $combo_1
$selectedItem = GuiRead($combo_1)
Select
   Case $selectedItem = "background color"
     ;GuiWrite($edit_1, -1, "");clear edit
      GuiWrite($edit_1, -1, '<body bgcolor=red>'& @CRLF &" ")
   Case $selectedItem = "hyperlink"
     ;GuiWrite($edit_1, -1, "");clear edit
      GuiWrite($edit_1, -1, '<a href="URL"></a>'& @CRLF & "")
   Case $selectedItem = "Aligns a paragraph"
     ;GuiWrite($edit_1,-1, "");clear edit
      GuiWrite($edit_1, -1, '<p align=?>'& @CRLF)
             Case $selectedItem = "bold text"
     ;GuiWrite($edit_1, -1, "");clear edit
      GuiWrite($edit_1, -1, '<b></b>' & @CRLF)
      Case $selectedItem = "italic text"
     ;GuiWrite($edit_1, -1, "");clear edit
      GuiWrite($edit_1, -1, '<i></i>' & @CRLF)
       Case $selectedItem = "size of font"
     ;GuiWrite($edit_1, -1, "");clear edit
      GuiWrite($edit_1, -1, '<font color=7></font>' & @CRLF)
      Case $selectedItem = "italic text"
     ;GuiWrite($edit_1, -1, "");clear edit
      GuiWrite($edit_1, -1, '<i></i>' & @CRLF)
      Case $selectedItem = "Body end"
     ;GuiWrite($edit_1, -1, "");clear edit
      GuiWrite($edit_1, -1, '</body></html>' & @CRLF)
   EndSelect
Case $msg = $button_1
   $Content = GUIRead($edit_1)
EndSelect

WEnd
Exit

I'm making a small html editor for my self .

Link to comment
Share on other sites

I assumed you knew how to write text and variables into a text file.

Here's how you want it:

$Content = GUIRead($edit_1)
$NewFile = @ScriptDir & "\NewFile.htm"

$OpenNewFile = FileOpen($NewFile, 2)
FileWrite($OpenNewFile, $Content)
FileClose($OpenNewFile)

Good luck.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...