erickutcher / httpdownloader

HTTP(S) download manager that uses input/output completion ports (IOCP).
https://erickutcher.github.io/#HTTP_Downloader
571 stars 62 forks source link

Feedback for overflown list entry #160

Closed char101 closed 3 years ago

char101 commented 3 years ago

Hi,

When a new entry is added via the command line or through the http server, and the number of items in the list exceeds the control height, there is no visual indicator that a new entry has been added (for confirmation). Would it be possible to add a visual indicator for such case, for example autoscrolling or adding an item count in the status bar?

Thanks.

erickutcher commented 3 years ago

Right now it's coded so that the first visible item always stays visible. It's a lot more efficient when it comes to adding a ton of items because I don't have to repaint the list every time an item gets added outside its visible area.

I could probably make it so that if the scrollbar is all the way to the bottom of the list, then the last item that gets added will remain visible. That would essentially cause it to autoscroll.

erickutcher commented 3 years ago

I ended up adding a panel in the status bar. It was easier than messing with the scroll position.

itemcount

erickutcher commented 3 years ago

A new version is up.

char101 commented 3 years ago

Thank you.

char101 commented 3 years ago

I just realized that it is possible to send a mousewheel event to the list control to scroll manually. Example in autoit.

#NoTrayIcon
#include <SendMessage.au3>

const $TITLE = '[CLASS:http_downloader_class]'

func _MakeLong($LoWord, $HiWord)
  return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF))
endfunc

local $url = $CmdLine[1]

local $cmd = @ScriptDir & '\HTTP_Downloader.exe'
$cmd &= ' --url "' & $url & '"'
$cmd &= ' --immediate'

local $hwnd = ControlGetHandle($TITLE, '', 'TreeListView1')
if @error then
  MsgBox(0, @ScriptName, 'Window not found')
  exit
endif

RunWait($cmd)
Sleep(100)
for $i = 1 to 5
  _SendMessage($hwnd, 0x020A, _MakeLong(0, -120), _MakeLong(0, 0))
  Sleep(10)
next
erickutcher commented 3 years ago

I added a setting in the Appearance options that'll let it scroll to the bottom of the list whenever an item is added. It'll basically perform the same action as pressing the End key.