qwert Posted May 19, 2014 Share Posted May 19, 2014 I was certain I had seen this basic capability in a simple example. But, after a day of looking at examples, I've only found text that can march across the screen ... and even fly in different directions. Can anyone point me to a basic capability? ... one that includes: ►Block with rounded corners ►Block size independent of the text size ►Font specified from the Win font library ►Entire block draggable from its initial position Attached is an example of the result I'm seeking. Thanks in advance for any help. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 19, 2014 Moderators Share Posted May 19, 2014 qwert,The Moving and Resizing PopUp GUIs tutorial in the Wiki shows you several ways to do the "draggable" bit - the "font" and "colour" requirements are done with basic AutoIt GUI functions. And there are umpteen "rounded corner" examples on the forum - use the Search facility to find them. 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...
qwert Posted May 19, 2014 Author Share Posted May 19, 2014 Thanks for the nudge. I found a starting point in an example on rounded-corner GUIs. Here's what I was able to construct: expandcollapse popup; ; Simple Floating Text Overlay ; #include <GuiConstants.au3> $sFont = "Comic Sans MS" $my_gui = GuiCreate("MyGUI", 900, 120, -1, -1, $WS_POPUP) _GuiRoundCorners($my_gui, 0, 0, 30, 30) GUISetBkColor(0x990000) GUICtrlSetDefColor(0xFFFFFF) GUICtrlCreateLabel("Floating block of overlaid text ... draggable.", 60, 30, 900, 60, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlSetFont(-1, 28, 400, 2, $sFont) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ; EndSelect WEnd Exit Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3) Dim $pos, $ret, $ret2 $pos = WinGetPos($h_win) $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $pos[2], "long", $pos[3], "long", $i_x3, "long", $i_y3) If $ret[0] Then $ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $ret[0], "int", 1) If $ret2[0] Then Return 1 Else Return 0 EndIf Else Return 0 EndIf EndFunc ;==>_GuiRoundCorners Dragging the whole background would be a nice touch, but this method serves my immediate purpose and meets my goal of simplicity. Thanks, again. Link to comment Share on other sites More sharing options...
qwert Posted January 23, 2015 Author Share Posted January 23, 2015 Dragging the whole background would be a nice touch For anyone following this, here's the function—in its simplest form—that makes the block draggable: : : GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST") : : Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam) If ($hWnd = $my_gui) And ($iMsg = $WM_NCHITTEST) Then Return $HTCAPTION EndFunc : 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