Search the Community
Showing results for tags 'scrolling'.
Found 5 results
Scrolling Single Line Graph UDF
Bilgus posted a topic in AutoIt Example ScriptsThis is an update or derivative work of Beege 's Scrolling Line Graph UDF https://www.autoitscript.com/forum/topic/109599-scrolling-line-graph-udf I noticed a few issues for my use case with the UDF one being that adding a sample required updating the waveform High CPU usage went hand in hand with that requirement Another issue was just how long updating took to complete I've hopefully rectified that with this version There are a few changes (only 1 line per graph for instance) The addition of a function AddSample (uses graphics paths to speed up drawing samples on update) Gridlines are only generated once A sample finished line can be added UpdateGraph allows you to compress the discarded portion of the graph (it looks kinda cool but uses more CPU) Lower Cpu usage Uses real Control Ids - it is a label control underneath so you get click events and can display text when control is disabled Example (Waveform.au3) Example 2 (peak.au3) UDF Updated: Previous Downloads [38 / 38/ 0] SSLG.au3 waveform.au3 Peak.au3
Scrollable area and resizing
mpower posted a topic in AutoIt GUI Help and SupportHi guys, I have a GUI which requires scrolling, however resizing is a bit of a problem because any time you scroll down/up and then resize, the controls move down/up and blank space is created within the scrollable area. Any help with maintaining scrollable area size to be fixed would be great. Here is a reproducer: To achieve the undesirable effect I described, simply run the script, scroll down and then resize window. You will notice that new blank space is created either on top or on bottom of the window depending on scrolling/resizing direction. Easiest way to see how bad it is, is to scroll down the page about half-way and then maximise the window. You will notice now a whole bunch of blank space is added to the top of the window and scrolling up simply shows nothing, scrolling down shows controls but they are cut off because of the blank space created on top of the page. This is all happening within the yellow bg child gui. I need to make it so that even if the GUI is resized the contents of the yellow bg child gui do not move and the scrollable area within the child gui remains the same. #NoTrayIcon #include-once #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GUIScroll.au3> #include <SendMessage.au3> Opt("GUIResizeMode", 802) Global $parentgui_w = 880, $parentgui_h = 810, $childgui_w = $parentgui_w - 2, $childgui_h = $parentgui_h - 292 $parentgui = GUICreate("Scrollbar resize problem", $parentgui_w, $parentgui_h, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) GUISetBkColor(0xFFFFFF, $parentgui) $childgui = GUICreate("", $childgui_w, $childgui_h, -5, 263, $WS_POPUP, $WS_EX_MDICHILD, $parentgui) GUISetBkColor(0xFFF123, $childgui) Dim $buttons For $i = 0 to 24 If $i > 0 Then $cPos = ControlGetPos($childgui, "", $buttons[$i - 1]) $buttons[$i] = GUICtrlCreateButton("Button " & $i + 1, ($childgui_w - 200) / 2, $cPos + $cPos + 50, 200, 80) Else $buttons[$i] = GUICtrlCreateButton("Button " & $i + 1, ($childgui_w - 200) / 2, 20, 200, 80) EndIf Next Scrollbar_Create($childgui, $SB_VERT, 130 * 25) Scrollbar_Step(15, $childgui, $SB_VERT) GUIRegisterMsg($WM_SIZE, "WM_SIZE") GUIRegisterMsg($WM_NCACTIVATE, "WM_NCACTIVATE") GUIRegisterMsg($WM_MOUSEWHEEL, "WM_MOUSEWHEEL") GUISetState(@SW_SHOW, $parentgui) GUISetState(@SW_SHOWNOACTIVATE, $childgui) While 1 $msg = GUIGetMsg(1) Switch $msg Case $parentgui Switch $msg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_RESTORE $pPos = WinGetPos($parentgui) WinMove($parentgui, "", Default, Default, $pPos+1, $pPos+1) WinMove($parentgui, "", Default, Default, $pPos-1, $pPos-1) EndSwitch EndSwitch WEnd Func WM_MOUSEWHEEL($hWnd, $iMsg, $wParam, $lParam) Local $iMw = BitShift($wParam, 16) $scroll_lines = 5 If $iMw > 0 Then For $i = 0 to $scroll_lines _SendMessage($childgui, $WM_VSCROLL, $SB_LINEUP) Next Else For $i = 0 to $scroll_lines _SendMessage($childgui, $WM_VSCROLL, $SB_LINEDOWN) Next EndIf Return $GUI_RUNDEFMSG EndFunc Func WM_SIZE($hwnd, $uMsg, $wParam, $lParam) If $hwnd = $parentgui Then $wPos = WinGetPos($parentgui) $pgui_wdiff = ($wPos - $parentgui_w) / 2 $pgui_hdiff = ($wPos - $parentgui_h) / 2 If $pgui_wdiff > 7 Then If $pgui_hdiff <> 0 Then If $wPos > $parentgui_w Then WinMove($childgui, "", $wPos + 2 + $pgui_wdiff, Default, $parentgui_w - 2, $wPos - 306) Else WinMove($childgui, "", $wPos + 2 + $pgui_wdiff, Default, $wPos - 16, $wPos - 306) EndIf Else WinMove($childgui, "", $wPos + 2 + $pgui_wdiff, Default) EndIf ElseIf $pgui_wdiff < 7 Then If $wPos <> -32000 Then WinMove($childgui, "", $wPos + 8, Default, $wPos - 16, $wPos - 306) EndIf ElseIf $pgui_hdiff > 42 Then WinMove($childgui, "", Default, Default, Default, $wPos - 306) EndIf EndIf Return 0 EndFunc Func WM_NCACTIVATE($hwnd, $imsg, $wparam) If $hwnd = $parentgui Then If NOT $wparam Then Return 1 EndIf Return $gui_rundefmsg EndFunc
scrolling GUICtrlCreateGroup groups
DrPickles posted a topic in AutoIt GUI Help and SupportI am interested in using scrolling groups for a dropdown box listing. I add the $WS_VSCROLL and it shows the group scroll control but never actually activates and the information goes past the group. any suggestions or workarounds? groupscroll.au3 #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=Form1.kxf $Form1 = GUICreate("Form1", 615, 438, 192, 124) $Group1 = GUICtrlCreateGroup("Group1", 184, 120, 305, 209, BitOR($GUI_SS_DEFAULT_GROUP,$WS_VSCROLL)) For $i = 0 To 20 Step 1 $drop = (20* $i) $Label2 = GUICtrlCreateLabel($i, 200, 140 + $drop, 28, 31) GUICtrlCreateCombo("module", 220, 140 + $drop, 121, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) Next GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
The title says it all really. I've tried to achieve this using arrays & dividing the gui into chunky blocks , but so far have fail.... Any idea would be appreciated. Thanks
Extended window capturing
Quinch posted a topic in AutoIt General Help and SupportI'm thinking about writing a screencap program that would capture not only the contents of a window but also, if the window stretches past the screen, to capture that too so I can have captures of large pages without having to glue them together by hand. The concept is simple enough - determine the dimensions and position of the window, store each individual pixel, send a page down command, compare pixels to see where the contents of the next page start, repeat. Problem is, is there any way to finally dump that pixel data into an actual image format?