Say update problem

Say update problem

Postby Marc Vanzegbroeck » Mon Jun 20, 2016 9:58 am

Hi,

In my program I have a routine to import some files.
I want to show on the dialog the file that I'm importing.
It's working fine, until the customer select another window/program.
That the text is not updated anymore. The rest is working.
The problem is that the customer thinks that the program is stopping importing.

Here is a sample-file to show the problem.

test.rc
Code: Select all  Expand view
1 24 "C:/_vmsdata/FWH64/fwh64/samples/WinXP/WindowsXP.Manifest64"

IMPORTFILES DIALOG 44, 33, 149, 92
EXSTYLE WS_EX_DLGMODALFRAME
STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Import Files"
FONT 8, "MS Sans Serif"
{
 CONTROL "Info", -1, "button", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 8, 8, 129, 32
 CONTROL "xxxxxxxxxxxxxxxxxx", 502, "static", SS_CENTER | WS_CHILD | WS_VISIBLE | WS_GROUP, 15, 22, 114, 8
 CONTROL "Start", 1000, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 40, 44, 61, 34
}
 


test.prg
Code: Select all  Expand view
#include "FiveWin.Ch"
static oSay
static sText
func test()
   local oDlg
   sText  := 'Press Start'

   DEFINE DIALOG oDlg RESOURCE "IMPORTFILES"

   REDEFINE SAY oSay PROMPT sText ID 502 OF oDlg
   REDEFINE BUTTON ID 1000  OF oDlg ACTION (startimport(),oDlg:end())

   ACTIVATE DIALOG oDlg CENTERED
return


func startimport()
    local i
    FOR i = 1 to 30
       sText = 'File '+str(i,2,0)
       oSay:refresh()
       inkey(1)
    NEXT
return
 

Is there a way that the update still works after selecting another program?
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Say update problem

Postby FranciscoA » Mon Jun 20, 2016 1:46 pm

Marc.
Try including SysRefresh()
Code: Select all  Expand view
func startimport()
    local i
    FOR i = 1 to 30
       sText = 'File '+str(i,2,0)
       oSay:refresh()
      SysRefresh()
       inkey(1)
    NEXT
return
 

Regards
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Say update problem

Postby karinha » Mon Jun 20, 2016 1:54 pm

Code: Select all  Expand view

1 24 "C:\FWH64\samples\WinXP\WindowsXP.Manifest64"
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7814
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Say update problem

Postby FranciscoA » Mon Jun 20, 2016 1:56 pm

Upsss....

Code: Select all  Expand view
func startimport()
    local i
    FOR i = 1 to 30
       sText = 'File '+str(i,2,0)
       oSay:SetText(sText)      //here
       oSay:refresh()      
      SysRefresh()    //here
       inkey(1)
    NEXT
return
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Say update problem

Postby karinha » Mon Jun 20, 2016 1:59 pm

Code: Select all  Expand view

func startimport()
    local i
    FOR i = 1 to 30
       sText = 'File '+str(i,2,0)
       oSay:refresh()
       //inkey(1)
       SysWait(.5)
    NEXT
return Nil
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7814
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Say update problem

Postby James Bott » Mon Jun 20, 2016 2:12 pm

According to my old notes, you need to use the setText() method.

oSay:SetText( "Change Text")

Regards,
James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Say update problem

Postby Marc Vanzegbroeck » Mon Jun 20, 2016 5:16 pm

Francisco, James,

This working fine
Code: Select all  Expand view
func startimport()
    local i
    FOR i = 1 to 30
       sText = 'File '+str(i,2,0)
       oSay:refresh()
       SysRefresh()
       inkey(1)
    NEXT
return
 


I didn,' had to use the
Code: Select all  Expand view
oSay:SetText(sText)


Karinha,
The syswait() is also working in this example, but in the real program, there is my import-function.
The inkey was just to delay the demo...
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 75 guests