adrmil Posted June 16, 2010 Share Posted June 16, 2010 how to load an image into a text edit? as escroll is configured to remain at the bottom, to insert text? #include <GuiEdit.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> Opt('MustDeclareVars', 1) _test() Func _test() Local $var = ' <img border="0" src="' & @ScriptDir & '\img\' & '4' & '.gif" height="8"> ' Local $hEdit, $hGUI $hGUI = GUICreate("edit test", 400, 200) $hEdit = GUICtrlCreateEdit("", 2, 2, 394, 195, BitOR($ES_WANTRETURN, $WS_VSCROLL)) GUISetState() Do Sleep(1000) _GUICtrlEdit_InsertText($hEdit, @SEC & $var & @CRLF, 0) Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_test Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 16, 2010 Moderators Share Posted June 16, 2010 adrmil,Welcome to the AutoIt forum. how to load an image into a text editYou answer your own question - why do you think you could put an image into a text edit? As far as I know there is no way to get images into a simple edit control, nor into a richtext one either. The controls are designed to edit text, as their name suggests.What exactly are you trying to do? We might be able to suggest something else. as escroll is configured to remain at the bottom, to insert text?I am afraid I do not understand what you mean here. Your _GUICtrlEdit_InsertText($hEdit, @SEC & @CRLF, 0) line (removing the image variable) inserts text perfectly at the top of the edit. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
JohnOne Posted June 16, 2010 Share Posted June 16, 2010 I think you should be looking at greating an IE object inside your gui to display images and text, as M23 pointed out edit wont do it. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
adrmil Posted June 16, 2010 Author Share Posted June 16, 2010 as text but in html format or something, to load an emoticon this code is somewhat illogical but it is to ask, I can insertat dynamic images and text but separately. pictures with "GUICtrlSetImage" or "GUICtrlCreatePic" and text in a different control. No way to upload it as Rich Text? html or any different to plain text? Link to comment Share on other sites More sharing options...
adrmil Posted June 17, 2010 Author Share Posted June 17, 2010 (edited) resolved that the scroll will remain in the bottom #include <GUIConstantsEx.au3> #include <GuiEdit.au3> Opt('MustDeclareVars', 1) test2() Func test2() Local $win, $txt Local $msg, $read, $sec, $user TCPStartup() $win = GUICreate(@UserName, 400, 200) $txt = _GUICtrlEdit_Create($win, "", 0, 2, 400, 200) $user = @UserName GUISetState() While 1 $sec = @SEC Sleep(1000) $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If _GUICtrlEdit_GetText($txt) <> "" Then _GUICtrlEdit_SetText($txt, _GUICtrlEdit_GetText($txt) & @CRLF & $read) Else _GUICtrlEdit_SetText($txt, _GUICtrlEdit_GetText($txt) & $read) EndIf If _GUICtrlEdit_GetText($txt) <> "" Then _GUICtrlEdit_SetText($txt, _GUICtrlEdit_GetText($txt) & @CRLF & $user & " -> " & $sec) Else _GUICtrlEdit_SetText($txt, _GUICtrlEdit_GetText($txt) & $user & " -> " & $sec) EndIf GUICtrlSetData($sec, "") _GUICtrlEdit_LineScroll($txt, _GUICtrlEdit_GetLineCount($txt) + 1, _GUICtrlEdit_GetLineCount($txt) + 1) WEnd Exit EndFunc ;==>test2 I keep trying but not know how to display an image next to the text Edited June 17, 2010 by adrmil Link to comment Share on other sites More sharing options...
DW1 Posted June 17, 2010 Share Posted June 17, 2010 As previously stated, you could just use an IE object in your app to accomplish a mix of all sorts of multimedia and text. Here is a small example: #include <IE.au3> #include <GUIConstantsEx.au3> _IEErrorHandlerRegister () $GUI = GUICreate("App", 500, 500, @DesktopWidth / 2) $oIE = _IECreateEmbedded() $GUIActiveX = GUICtrlCreateObj($oIE, 10, 10, 480, 480) _IENavigate($oIE, 'about:blank') _IEBodyWriteHTML($oIE, 'some text here, and a smiley <img src="http://memeart.tripod.com/smiley2.gif"> inbetween it.') GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch Sleep(10) WEnd AutoIt3 Online Help Link to comment Share on other sites More sharing options...
adrmil Posted June 18, 2010 Author Share Posted June 18, 2010 (edited) is what he was looking for. I'll try with this code, thank you very much .... sorry if my English is strange use a translator to write Edited June 18, 2010 by adrmil 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