Jump to content
Sign in to follow this  
rasim

ListView_Progress

Recommended Posts

rasim

Hi all! This is my first UDF and if anyone will found a bug in this UDF or have any ideas about improvement, that posting your message. :)

Posted Image

Edit: Updated as advise arcker :(

Edit: Fixed bug.

2008.10.06

Added a _Progress_Delete function, thanks to MrCreatoR.

2008.10.07

Many bugs are fixed.

Reduced CPU usage (little).

2008.10.08

Changed code algorithm.

Reduced CPU usage.

2008.10.09

Fully code rewrited.

Code optimized.

Some bugs fixed.

ListView_with_ProgressBar.zip

Edited by rasim

Share this post


Link to post
Share on other sites
Andreik

Your UDF is really nice!

Nice work! :)


When the words fail... music speaks

Share this post


Link to post
Share on other sites
ptrex
monoceres

Looks real nice :)

Keep up the good work :(


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
GtaSpider

Respect, nice work :)

your Spider


www.AutoIt.de - Moderator of the German AutoIt Froum

Share this post


Link to post
Share on other sites
Armand

Issues if there is a need to scroll + it slows down the listview like 100 times normal...

but nice script !!!

who knows maybe someday jon & garry will implement such an option into autoit and we'll all be happy :)


[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Share this post


Link to post
Share on other sites
MerkurAlex

Wow right when i was needing this i find it great work!


[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Share this post


Link to post
Share on other sites
rasim

Thanks for your comments guys! :)

Share this post


Link to post
Share on other sites
arcker

here are some features that i've added

fortunately i often use PaulIA progress bar functions.

My method doesn't use any of autoit gui function, juste API

it permits to bypass ctrlgethandle and _WinApi_SetParent.

here is the code :

Example

#include <GUIConstants.au3>
#include <GuiListView.au3>
#include <ListView_Progress.au3>

Global $iProgress = 0

$hGui = GUICreate("ListView with progressbar", 420, 280, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX))

$hListView = GUICtrlCreateListView("Files|Path|Progress", 10, 10, 400, 240, BitOR($LVS_REPORT, $WS_BORDER))

_GUICtrlListView_BeginUpdate($hListView)

_GUICtrlListView_SetColumnWidth($hListView, 0, 100)
_GUICtrlListView_SetColumnWidth($hListView, 1, 140)
_GUICtrlListView_SetColumnWidth($hListView, 2, 150)

_GUICtrlListView_AddItem($hListView, "AutoIT")
_GUICtrlListView_AddItem($hListView, "Opera")
_GUICtrlListView_AddItem($hListView, "Script")
_GUICtrlListView_AddItem($hListView, "Work")
_GUICtrlListView_AddItem($hListView, "New")
_GUICtrlListView_AddItem($hListView, "Test")
_GUICtrlListView_AddItem($hListView, "Image")
_GUICtrlListView_AddItem($hListView, "Soft")
_GUICtrlListView_AddItem($hListView, "News")
_GUICtrlListView_AddItem($hListView, "Info")

_GUICtrlListView_AddSubItem($hListView, 0, "C:\Program Files\AutoIt3", 1)
_GUICtrlListView_AddSubItem($hListView, 1, "C:\Program Files\Opera", 1)
_GUICtrlListView_AddSubItem($hListView, 2, "C:\MyScript\Work", 1)
_GUICtrlListView_AddSubItem($hListView, 3, "C:\New\Script", 1)
_GUICtrlListView_AddSubItem($hListView, 4, "C:\Image\Image", 1)
_GUICtrlListView_AddSubItem($hListView, 5, "C:\Soft\New", 1)
_GUICtrlListView_AddSubItem($hListView, 6, "C:\Music\Info", 1)
_GUICtrlListView_AddSubItem($hListView, 7, "C:\Video\Soft", 1)
_GUICtrlListView_AddSubItem($hListView, 8, "C:\Project\Script", 1)
_GUICtrlListView_AddSubItem($hListView, 9, "C:\Work\Script", 1)

_GUICtrlListView_EndUpdate($hListView)

$hProgress1  = _ListView_InsertProgressBar($hListView, 0, 2)
_Progress_SetBarColor($hProgress1,0xFF0000)
$hProgress2  = _ListView_InsertProgressBar($hListView, 1, 2)
_Progress_SetBarColor($hProgress2,0x00FF00)
$hProgress3  = _ListView_InsertProgressBar($hListView, 2, 2)
_Progress_SetBarColor($hProgress3,0x0000FF)
$hProgress4  = _ListView_InsertProgressBar($hListView, 3, 2)
_Progress_SetBkColor($hProgress3,0xFF00FF)
$hProgress5  = _ListView_InsertProgressBar($hListView, 4, 2)
_Progress_SetStep($hProgress5,34)
$hProgress6  = _ListView_InsertProgressBar($hListView, 5, 2)
$hProgress7  = _ListView_InsertProgressBar($hListView, 6, 2)
$hProgress8  = _ListView_InsertProgressBar($hListView, 7, 2)
$hProgress9  = _ListView_InsertProgressBar($hListView, 8, 2)
$hProgress10 = _ListView_InsertProgressBar($hListView, 9, 2)

GUISetState()

AdlibEnable("_Progress",100)

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

Func _Progress()
    If $iProgress = 100 Then $iProgress = 0
    $iProgress += 10
    ;sleep(100)
    _Progress_SetPos($hProgress1, $iProgress + 10)
    _Progress_SetPos($hProgress2, $iProgress)
    _Progress_SetPos($hProgress9, $iProgress)
    _Progress_SetPos($hProgress3, $iProgress)
    _Progress_StepIt($hProgress5)
EndFunc   ;==>_ProgressoÝ÷ ٩ݶ®¥Ö­yÕ«­¢+Ø¥¹±Õµ½¹(¥¹±Õ±ÐíU%
 
Edited by arcker

-- Arck System _ Soon -- Ideas make everything

"La critique est facile, l'art est difficile"

Projects :

[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]

Share this post


Link to post
Share on other sites
rasim

arcker

Wow! This great! Thank you! I update the first post. :) Now you coauthor :(

But i don`t understand why need this:

If BitAND($iStyle, $PBS_VERTICAL) = 0 Then
        If $iHeight = -1 Then $iHeight = _WinAPI_GetSystemMetrics($SM_CYVSCROLL)
        If $iWidth  = -1 Then $iWidth  = 150
    Else
        If $iHeight = -1 Then $iHeight = 150
        If $iWidth  = -1 Then $iWidth  = _WinAPI_GetSystemMetrics($SM_CXVSCROLL)
    Endif

Script work fine without this part.

Share this post


Link to post
Share on other sites
arcker

erf yes

effectively, this part of script is when you create a vertical progress bar

PaulIA have added getsystemmetrics to set default width when you create without specifying this.

it uses the default system size for vertical scroll bar

so, yes, not needed here.

thx for the quote :)

the best listview that i have seen are in EmuleMorph P2P program. it uses progress bar with multicolor parts in listviews . Really amazing.


-- Arck System _ Soon -- Ideas make everything

"La critique est facile, l'art est difficile"

Projects :

[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]

Share this post


Link to post
Share on other sites
rasim

Bug fixed. Updated the first post. :)

Posted Image

Share this post


Link to post
Share on other sites
JohnRichard

why is that when i copied the updated UDF and execute the code it doesn't display anything on me?

Share this post


Link to post
Share on other sites
rasim

JohnRichard

Hope you run example below UDF? ;)

Share this post


Link to post
Share on other sites
BrettF

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
Sign in to follow this  

×