Jump to content

Recommended Posts

Posted

I found out my problem from above by removing "onclick="return falsed" it allows the link to go through. Now I just want to add a background image. I know I can do that by the following running the .au3 but when Compiled the resource isn't loading. I have looked at GDI_Plus.... stuff but am unable to figure out how to insert a $hBitmap into $oShell Object... I know that ResourceGet() from Zedna returns hBitmap using RT_BITMAP. I just don't know how to insert that into $oShell from the Marquee.

#AutoIt3Wrapper_Res_File_Add=CITS.bmp, rt_bitmap, BACKGROUND


With $oShell.document
If @Compiled Then
$Bitmap = _ResourceGet("BACKGROUND", $rt_bitmap)
Else
$Bitmap = @ScriptDir & "CITS.bmp"
EndIf
        .write('<style>marquee{cursor: default}></style>')
        .write('<body background="' & $Bitmap & '" onselectstart="return false" oncontextmenu="return false" ondragstart="return false" ondragover="return false">')
        .writeln('<marquee width=100% height=100%')
        .writeln("loop=" & $iMarquee_Loop)
        .writeln("behavior=" & $sMarquee_Move)
        .writeln("direction=" & $sMarquee_Direction)
        .writeln("scrollamount=" & $iMarquee_Scroll)
        .writeln("scrolldelay=" & $iMarquee_Delay)
        .write(">")
        .write($sText)
        .body.title = $sTipText
        .body.topmargin = 0
        .body.leftmargin = 0
        .body.scroll = "no"
        .body.style.color = $vMarquee_TxtCol
;~         .body.bgcolor = $sMarquee_BkCol
        .body.style.borderWidth = $iMarquee_Border
        .body.style.fontFamily = $sMarquee_FontFamily
        .body.style.fontSize = $iMarquee_FontSize
    EndWith
  • 2 weeks later...
Posted (edited)

Found Solution to adding image to background of marquee. Just upload image to a site i.e. TinyPic then just insert url like so:

.write('<body background="http://www.tinypicurl.com/img.jpg" onselectstart="return false" oncontextmenu="return false" ondragstart="return false" ondragover="return false">')
Edited by rogue5099
  • 4 months later...
Posted (edited)

@Melba23 to change the text have to recreate the control, you could put the function _GUICtrlMarquee_SetData?

_GUICtrlMarquee_SetScroll : Sets movement parameters for Marquee

_GUICtrlMarquee_SetDisplay : Sets display parameters for Marquee

_GUICtrlMarquee_Create : Creates Marquee

_GUICtrlMarquee_SetData : change the text

Edited by Belini
  • Moderators
Posted

Belini,

to change the text have to recreate the control, you could put the function _GUICtrlMarquee_SetData?

I could indeed - if I had any idea of how to do it! :D

I will take a look, but if you have any suggestions I am all ears. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Posted (edited)

@Melba23 to change the text have to recreate the control, you could put the function _GUICtrlMarquee_SetData?

Perhaps Dale Hohm knows if the text can be replaced without resetting the scroll position.

A standalone example with a modified __GUICtrlMarquee_Create and Marquee.au3 include excluded

;#include <Marquee.au3>

Global $iMarquee_Loop      = 0
Global $sMarquee_Move      = "scroll"
Global $sMarquee_Direction  = "left"
Global $iMarquee_Scroll  = 6
Global $iMarquee_Delay    = 85
Global $iMarquee_Border  = 0
Global $vMarquee_TxtCol  = Default
Global $sMarquee_BkCol    = Default
Global $sMarquee_FontFamily = "Tahoma"
Global $iMarquee_FontSize   = 12

Global $oShell_1
GUICreate("Marquee Example", 320, 220)
__GUICtrlMarquee_Create($oShell_1, "Default Marquee Parameters",    10,  10, 300, 20)
GUISetState()
Sleep(6000)
__GUICtrlMarquee_SetText($oShell_1, "New Marquee Text")


While 1
    If GUIGetMsg() = -3 Then Exit
WEnd


Func __GUICtrlMarquee_Create(ByRef $oShell, $sText, $iLeft, $iTop, $iWidth, $iHeight, $sTipText = "")

    ; Declare Local variables
    Local $iCtrlID

    $oShell = ObjCreate("Shell.Explorer.2")
    If Not IsObj($oShell) Then Return SetError(1, 0, -1)

    $iCtrlID = GUICtrlCreateObj($oShell, $iLeft, $iTop, $iWidth, $iHeight)

    $oShell.navigate("about:blank")
    While $oShell.busy
        Sleep(100)
    WEnd

    With $oShell.document
        .write('<style>marquee{cursor: default}></style>')
        .write('<body onselectstart="return false" oncontextmenu="return false" onclick="return false" ondragstart="return false" ondragover="return false">')
        .writeln('<marquee width=100% height=100%')
        .writeln("loop=" & $iMarquee_Loop)
        .writeln("behavior=" & $sMarquee_Move)
        .writeln("direction=" & $sMarquee_Direction)
        .writeln("scrollamount=" & $iMarquee_Scroll)
        .writeln("scrolldelay=" & $iMarquee_Delay)
        .write(">")
        .write($sText)
        .body.title = $sTipText
        .body.topmargin = 0
        .body.leftmargin = 0
        .body.scroll = "no"
        .body.style.color = $vMarquee_TxtCol
        .body.bgcolor = $sMarquee_BkCol
        .body.style.borderWidth = $iMarquee_Border
        .body.style.fontFamily = $sMarquee_FontFamily
        .body.style.fontSize = $iMarquee_FontSize
    EndWith

    Return $iCtrlID

EndFunc ;=> _GUICtrlMarquee_Create

Func __GUICtrlMarquee_SetText(ByRef $oShell, $sText)
    If Not IsObj($oShell) Then Return SetError(1, 0, -1)
    $oShell.document.body.innerHTML = '<body onselectstart="return false" oncontextmenu="return false" onclick="return false" ondragstart="return false" ondragover="return false"> ' & _
    '<marquee width=100% height=100% ' & "loop=" & $iMarquee_Loop & " behavior=" & $sMarquee_Move & " direction=" & $sMarquee_Direction & " scrollamount=" & $iMarquee_Scroll & _
    " scrolldelay=" & $iMarquee_Delay & ">" & $sText
EndFunc ;=> __GUICtrlMarquee_SetText
Edited by rover

I see fascists...

  • Moderators
Posted

rover,

Thanks for that - I can see how to incorporate that into a UDF. :thumbsup:

And I will need to add a _GUICtrlMarquee_Delete function as well - so thanks for that too. :P

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

  • Moderators
Posted

And the new UDF can be found here. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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