Jump to content

Flashing ListView Item


Recommended Posts

I'm working on a application that will let you upload a file to multiple file hosting websites (rapidshare, megaupload, ect.) however I'm having an issue, I have the design of the GUI down (no functions created yet) however while testing the list view i have the issue that the last item added to the list view flashes repeately and I can't figure out how to fix this

Here's the scrip:

#include <GUIConstants.au3>
 #include <GuiListView.au3>
 #include <EzSkin.au3>
 
 Global $FontColor = '0xFFFFFF'
 Global $LastUploadDir = @MyDocumentsDir
 
 $EzGUI = EzSkinGUICreate("LacWare Uploader",500,500)
 $EzIcon = EzSkinIcon($EzGUI)
 
 EzSkinLabel('File(s):', 25, 50, 50, 15)
 $CurrentInput = GuiCtrlCreateInput('', 80, 50, 260, 15)
 $Browse = EzSkinButton('Browse', 350, 50, 50, 15)
 $Add = EzSkinButton('Add to List', 410, 50, 60, 15)
 
 $ListView = GuictrlCreateListView('Files waiting for upload', 25, 75, 450, 200)
 _GUICtrlListView_SetColumnWidth($ListView, 0,445)
 
 
;Seperator
 GuiCtrlCreateLabel('', 15, 375, 470, 3)
 GuiCtrlSetBKColor(-1, '0x4169E1')
 
;Servers
 
 $RapidShare = GuiCtrlCreateCheckbox('RapidShare.com', 20, 390, 100, 15)
 $Megaupload = GuiCtrlCreateCheckbox('Megaupload.com', 20, 410, 100, 15)
 $UploadTo = GuiCtrlCreateCheckbox('Upload.to', 20, 430, 100, 15)
 $TurboUpload = GuiCtrlCreateCheckbox('TurboUpload.com', 20, 450, 100, 15)
 $FilesTo = GuiCtrlCreateCheckbox('Files.to', 20, 470, 100, 15)
 
 $RapidUpload = GuiCtrlCreateCheckbox('Rapidupload.com', 140, 390, 100, 15)
 $Axifile = GuiCtrlCreateCheckbox('Axifile.com', 140, 410, 100, 15)
 $Zshare = GuiCtrlCreateCheckbox('zshare.net', 140, 430, 100, 15)
 $Myfreefilehosting = GuiCtrlCreateCheckbox('Myfreefilehosting...', 140, 450, 100, 15)
 $Zupload = GuiCtrlCreateCheckbox('zupload.com', 140, 470, 100, 15)
 
 $Divshare = GuiCtrlCreateCheckbox('DivShare.com', 260, 390, 100, 15)
 $Egoshare = GuiCtrlCreateCheckbox('Egoshare.com', 260, 410, 100, 15)
 $Zerowaitingtime = GuiCtrlCreateCheckbox('Zerowaitingtime...', 260, 430, 100, 15)
 $GigaSize = GuiCtrlCreateCheckbox('GigaSize.com', 260, 450, 100, 15)
 $MiHd = GuiCtrlCreateCheckbox('MiHd.net', 260, 470, 100, 15)
 
 $IfileIt = GuiCtrlCreateCheckbox('iFile.it', 380, 390, 100, 15)
 $Mediafire = GuiCtrlCreateCheckbox('Mediafire.com', 380, 410, 100, 15)
 
 $SuggestServer = EzSkinButton('Suggest Another', 380, 440, 100, 15)
 
 GUISetState()
 
 While 1
     EzSkinOver()
     $msg = GUIGetMsg()
     Select
         Case $Msg = $EzIcon[1] 
             Exit
         Case $Msg = $EzIcon[2]
             GuiSetState(@SW_Minimize, $EzGui)
         Case $Msg = $Browse
             $File = FileOpenDialog('Select file(s) to upload', $LastUploadDir, 'All Files (*.*)', 4)
             GuiCtrlSetData($CurrentInput, $File)
         Case $Msg = $Add
             GuiCtrlCreateListViewItem(GuiCtrlRead($CurrentInput), $ListView)
         Case $Msg = $SuggestServer
             $NewServer = InputBox('Suggest Server', 'Enter another server you would like added' & @CRLF & 'Be sure to include .com, org, ect.', 'www.exampleserver.to')            
     EndSelect
 WEnd
 
 Func EzSkinLabel($iText, $iLeft, $iTop, $iWidth, $iHeight, $iColor = $FontColor, $iSize = 10, $iWeight = 600)
     Local $Return
     $Return = GuiCtrlCreateLabel($iText, $iLeft, $iTop, $iWidth, $iHeight)
     GuiCtrlSetFont($Return, $iSize, $iWeight)
     GuiCtrlSetColor(-1, $FontColor)
     Return $Return
 EndFunc
Link to comment
Share on other sites

Case $Msg = $Add
        _GuiCtrlListView_EndUpdate($ListView)
        GuiCtrlCreateListViewItem(GuiCtrlRead($CurrentInput), $ListView)
        _GuiCtrlListView_BeginUpdate($ListView)

ok so I updated it with the following lines, now it doesn't flash but the first input won't show up until theres a second one and then it works perfect.

Link to comment
Share on other sites

It should be:

GuiCtrlListView_BeginUpdate($ListView)

GuiCtrlCreateListViewItem(GuiCtrlRead($CurrentInput), $ListView)

_GuiCtrlListView_EndUpdate($ListView)

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Nice use of EzSkin AcidCorps...

however, your EzSkinLabel uses an incorrect parameter

Func EzSkinLabel($iText, $iLeft, $iTop, $iWidth, $iHeight, $iColor = $FontColor, $iSize = 10, $iWeight = 600)
     Local $Return
     $Return = GuiCtrlCreateLabel($iText, $iLeft, $iTop, $iWidth, $iHeight)
     GuiCtrlSetFont($Return, $iSize, $iWeight)
     GuiCtrlSetColor(-1, $FontColor)
     Return $Return
EndFunc

this line should be

GuiCtrlSetColor(-1, $iColor)

not

GuiCtrlSetColor(-1, $FontColor)

again, nice one

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...