Jump to content

Recommended Posts

Posted (edited)

We can use this to create arbitrarily complex GUI structures very easily. Parameters of each and any structure can be modified by changing the css during runtime.

Normally, javascript does that in browsers. You could use javascript (either find a dll version of a js engine, or use plugins to wrap one,) but using autoit will be faster, more efficient, and more reliable when using this UDF.

I actually really like this - check out my Transitions & Tweening UDF. You can use that on any css parameter to get special effects - size, color, position, transparency. This gives us the foundation for some really slick GUI widgets. (That is, if you want to control from AutoIt , CSS! script is the direct interface.)

5 stars!

Edited by JRowe
Posted (edited)

Input masks. ^^

For now I am using this:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>

_IEErrorHandlerRegister ()

$oIE = _IECreateEmbedded ()
GUICreate("Embedded Internet Explorer", 800, 600, _
        (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2)
$GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 800, 600)
GUISetState()       ;Show GUI

_IENavigate ($oIE, "about:blank") ;necessary. i don't know why.
$sHTML = ""
$sHTML &= "<html>" & @CR
$sHTML &= "<head>" & @CR
$sHTML &= "<script>" & @CR
$sHTML &= "window.onload = function () { alert(document.title) }" & @CR
$sHTML &= "</script>" & @CR
$sHTML &= "<title>Teste</title>" & @CR
$sHTML &= "</head>" & @CR
$sHTML &= "<body>" & @CR
$sHTML &= "</body>" & @CR
$sHTML &= "Olá mundo!" & @CR
$sHTML &= "</html>"
_IEDocWriteHTML ($oIE, $sHTML)
;_IEAction ($oIE, "refresh") ;some times necessary ex.: write a frameset

; Waiting for user to close the window
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd

GUIDelete()

Exit
Edited by Splash
Automatic Update UDF - IP Address UDF - WinPcap AutoIt _FindDevice()[font="Verdana"][size="2"]AutoIt Spanish/Brasil/World community!!![/size][/font]Use you wanna a dot.tk domain please use my link:
Posted

How do we enable interacting with text? I can't highlight or select anything, and no keyboard input works.

Posted

Input masks. ^^

Sorry i don't understand what you want

How do we enable interacting with text? I can't highlight or select anything, and no keyboard input works.

you can use accesskeys behavior for give focus, see html_samples\behaviors\accesskeys.htm in sdk.

you can also use csss, see html_samples\csss!\keyboard-handling.htm.

for receiving key event try _HLWindowAttachEventHandler($HLHwnd, "_events", $HANDLE_KEY )

i actualy work on sciter udf (sciter is htmlayout + tiscript), sciter is up to date and correct some bug i have with opacity background.

when i finish i will make an transparent osd menu exemple.

Posted

How do we enable interacting with text? I can't highlight or select anything, and no keyboard input works.

i actualy work on sciter udf (sciter is htmlayout + tiscript), sciter is up to date and correct some bug i have with opacity background.

when i finish i will make an transparent osd menu exemple.

Sciter UDF is out, try osd menu exemple.

  • 4 months later...
Posted

i have an application , is Bitdefender 2011 setup , who use HtmLayout.dll

some more info here http://www.autoitscript.com/forum/index.php?showtopic=119053

Au3Info.exe cant give other infos than Title and Class for main window , and nothing from controls.

can i use HtmLayout DLL UDF or Sciter Dll UDF

for managing a silent install for this installer ?

i am interesting in something simple like

winwait , controlclick , controlsend ...

can i grab infos about controls, windows ?

if yes , which one is recommended for start ?

  • 9 months later...
Posted (edited)

Does'nt works with the last DLL version.

Nobody can upgrade the UDF ?

I have systematically the error :

Return $result[0]
Return $result^ ERROR

So DllCall in HLStartup returns nothing.

I don't find the new parameters used to call HTMLayout DLL, so I can't upgrade the UDF.

Is it an UDF problem ? Please help me, thanks.

Edited by RedBust
  • 2 months later...
  • 3 months later...
Posted (edited)

Very nice!

But i just want to know something:

How is it possible to scroll down the HTMLayout control???

Like this with IE:

$oIE.document.body.scrollTop = Number($oIE.document.body.scrollHeight)

Another question:

In a HTMLayout Control, how could I select and Copy some text, if for example i want to past it elsewhere?????

Thanks!

Edited by matwachich
  • 9 months later...
Posted

I was just wondering, because I did not see any functions in the list to do it.

Is there a way to scroll the control all the way to the bottom? Like how with the internet explorer object you can tell it to scroll down it's full height, for an html formatted chat window.

Thanks

Posted

layout.htm in text is only english?

not support unicode?

edit layout.htm in

<div .playground>

<caption>캡션 1</caption>

<div .expandable>

첫번째 패널

output

???? 1

?????? ????

there output

I interest am many quite in AutoitScript.From that is [http://cafe.naver.com/autoitscript[/color]] Korea of cafe(blog) to be operating, [size="2"][color="#ff00ff"]English cannot well[/size].Many help it requests.To read, it stands it thanks.

Posted

Is there a way to scroll the control all the way to the bottom? Like how with the internet explorer object you can tell it to scroll down it's full height, for an html formatted chat window.

I would create an element with an ID at the end of the page and the scroll to this id. I know that's possible but I forgot the commands to do so.

@davidkim: Did you save that file as utf and added the charset to the headers or something like that?

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Posted

I would create an element with an ID at the end of the page and the scroll to this id. I know that's possible but I forgot the commands to do so.

@davidkim: Did you save that file as utf and added the charset to the headers or something like that?

Yes, I could make each message have an ID, and scroll to the bottommost id, but without the command to scroll idk how to do the scrolling o.o

Hopefully someone else knows.

Posted (edited)

I searched in my scripts and found this. It won't work well if the last message is wider than the window, though.

Func _HTMLayout_ScrollToEnd($he)
; Author: ProgAndy
; scrolls the end of the given html element into view.
Local $cnt = _HTMLayoutGetChildrenCount($he)
If $fScrollDown And $cnt Then
Local $c = _HTMLayoutGetNthChild($he, $cnt - 1)
_HTMLayoutScrollToView($c, 0x11)
_HTMLayout_UnuseElement($c)
EndIf
EndFunc ;==>_HTMLayout_ScrollToEnd

; Example:
                   Local $root = _HTMLayoutGetRootElement($hHTMLLayout)
                    Local $body = _HTMLayoutGetNthChild($root, 1)
                   _HTMLayout_UnuseElement($root)
                    _HTMLayoutSetElementHtml($body, BinaryToString(StringToBinary($sEntry, 4), 1), -1, $SIH_APPEND_AFTER_LAST) ; append utf-8 encoded string
                    _HTMLayout_ScrollToEnd($body)
                    _HTMLayout_UnuseElement($body)

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Posted (edited)

I searched in my scripts and found this. It won't work well if the last message is wider than the window, though.

Func _HTMLayout_ScrollToEnd($he)
; Author: ProgAndy
; scrolls the end of the given html element into view.
Local $cnt = _HTMLayoutGetChildrenCount($he)
If $fScrollDown And $cnt Then
Local $c = _HTMLayoutGetNthChild($he, $cnt - 1)
_HTMLayoutScrollToView($c, 0x11)
_HTMLayout_UnuseElement($c)
EndIf
EndFunc ;==>_HTMLayout_ScrollToEnd

; Example:
Local $root = _HTMLayoutGetRootElement($hHTMLLayout)
Local $body = _HTMLayoutGetNthChild($root, 1)
_HTMLayout_UnuseElement($root)
_HTMLayoutSetElementHtml($body, BinaryToString(StringToBinary($sEntry, 4), 1), -1, $SIH_APPEND_AFTER_LAST) ; append utf-8 encoded string
_HTMLayout_ScrollToEnd($body)
_HTMLayout_UnuseElement($body)

Oh, wow, thanks! (and yeah I will just use 100% divs, I want the text to wrap anyways.

Edit: After a look over your code (still haven't tested yet), does this code automatically scroll to the end of the entire control? or, do I need to provide an ID?

Sorry I am a little confused by it, I don't see anywhere that an element is defined, I only see a variable called $body

I am mostly confused by this line, _HTMLayoutSetElementHtml($body, BinaryToString(StringToBinary($sEntry, 4), 1), -1, $SIH_APPEND_AFTER_LAST), what exactly is controling? (I guess what is the variable $body referring to?)

Edited by nullschritt
  • 7 months later...
Posted

That's really terrific!But is there an example for that?I tried while failed to run my file with "htmlayout".Could you please help give me one?Grate thanks ~

  • 3 months later...
Posted

Hi,

i have detect a mistake in this UDF.
 

Func _HLSetElementState
$result = DllCall($HtmLayoutdll, "int", "HTMLayoutGetElementState", "ptr", $el, "UINT", $stateToSet, "UINT", $stateToClear, "BOOL", $upt)

should be :

Func _HLSetElementState
$result = DllCall($HtmLayoutdll, "int", "HTMLayoutSetElementState", "ptr", $el, "UINT", $stateToSet, "UINT", $stateToClear, "BOOL", $upt)

HTMLayoutGetElementState ----> HTMLayoutSetElementState

 

regards.

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
  • Recently Browsing   0 members

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