Sign in to follow this  
Followers 0
friends

Is this Refresh Problem ?

5 posts in this topic

The script here works well... but only the 1st time you run it, the GUI windows

have the refresh problem.... Or is it my coding bugs ? how to fix it ?

#include <GUIConstants.au3>
#include <file.au3>


HotKeySet ("{ENTER}", "Terminate")


$Labely1 = 50  ; 1st item starts at 50 pixel
$Labely2 = 50  ; 1st item starts at 50 pixel
$Labely3 = 50  ; 1st item starts at 50 pixel

$destination = @TempDir & "\sku.txt"
FileInstall ("D:\store\dat\sku.txt", $destination)

$file = FileOpen ("d:\store\dat\sku.txt", 0)
$linecount = _FileCountLines ("d:\store\dat\sku.txt")
$GUIHeight = 70 + ($linecount * 26)  ; After header will start at 70, each item uses 26 pixels

GUICreate ("SKU Table", 500, $GUIHeight, -1, -1, -1)
GUISetFont (12, 800, -1, "Arial")
GUICtrlCreateLabel ("SKUs Reference Table", 115, 10, 280, -1, $SS_CENTER, -1)
GUISetFont (10, 800, -1, "Arial")
GUICtrlCreateLabel ("", 10, 40, 475, 28, $SS_ETCHEDFRAME, -1)
GUICtrlCreateLabel ("SKU", 22, 45, -1, 20)
GUICtrlCreateLabel ("Item Description", 80, 45, -1, 20)
GUICtrlCreateLabel ("RM", 450, 45, -1, 20)


GUISetState(@SW_SHOW)

WHILE 1
           
      $LineVal = FileReadLine ($file)
      $Labely1 = $Labely1 + 25
      $Labely2 = $Labely2 + 25
      $labely3 = $Labely3 + 25

      IF @ERROR = -1 THEN ExitLoop 
         
      $SKUInfo = StringSplit ($LineVal, ",")
      $SKU = $SKUInfo[1]
      $Desc = $SKUInfo[2]
      $Price = $SKUInfo[3]
      
     ;MsgBox (0, "", $SKU)
     ;MsgBox (0, "", $Desc)
     ;MsgBox (0, "", $Price)
   
      

      GUISetFont (10, 800, -1, "Arial")
      GUICtrlCreateLabel ($SKU, 20, $Labely1)   
      GUICtrlCreateLabel ($Desc, 80, $Labely2, 333, -1)
      GUICtrlCreateLabel ($Price, 430, $Labely3, 45, -1, $SS_RIGHT, -1)            
WEND 

WHILE 1
      $msg = GUIGetMsg()      
            
      IF $msg = $GUI_EVENT_CLOSE THEN 
         Exit
      ENDIF 
WEND 


Func Terminate()
     Exit 
EndFunc

Text file (.txt) please download it from below

My 2nd question on this is, let's say if the data in .txt file is more than 10,

and i wanted it to have a Vertical Scroll after more than 10 records, what

should i add ? Mind to provide me a sample or help me out with this coding ?

NOTE : This is my very first time to have scroll bar thing. Big Thanks

SKU.txt

Share this post


Link to post
Share on other sites



Attached a screenshot of what I see before a "refresh".... interesting

As for scrollbars, there was another thread about them, but I don't think there was a final soultion in the end. See http://www.autoitscript.com/forum/index.php?showtopic=5637


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Attached a screenshot of what I see before a "refresh".... interesting

As for scrollbars, there was another thread about them, but I don't think there was a final soultion in the end.  See http://www.autoitscript.com/forum/index.php?showtopic=5637

<{POST_SNAPBACK}>

@CS,

yes... that is what I've got when I run the script in WinXP-SP1. However,

I tested it on W2K machine (SP4), it works OK except for the very first line

of data (.txt file).

I wonder that is a bug or what ?

Anybody came across this problem ? And, what is the solution ? :)

Thanks for the helps.......

EDIT : If you run the script in Windows 2000 Professional SP-4, it looks like this :

Edited by friends

Share this post


Link to post
Share on other sites

I found the solution. Uploaded to Jon :)

Share this post


Link to post
Share on other sites

I found the solution. Uploaded to Jon :)

<{POST_SNAPBACK}>

@jpm, wow, thanks for the update ! :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0