Jump to content

HtmLayout DLL UDF !


GMib
 Share

Recommended Posts

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

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:
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 4 months later...

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 ?

Link to comment
Share on other sites

  • 9 months later...

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

  • 2 months later...
  • 3 months later...

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

  • 9 months later...

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

  • 7 months later...
  • 3 months later...

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.

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...