FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Say update problem
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Say update problem
Posted: Mon Jun 20, 2016 09: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 (fw): Select all Collapse
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 (fw): Select all Collapse
#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
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Say update problem
Posted: Mon Jun 20, 2016 01:46 PM
Marc.
Try including SysRefresh()
Code (fw): Select all Collapse
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
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Say update problem
Posted: Mon Jun 20, 2016 01:54 PM
Code (fw): Select all Collapse
1 24 "C:\FWH64\samples\WinXP\WindowsXP.Manifest64"
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Say update problem
Posted: Mon Jun 20, 2016 01:56 PM
Upsss....

Code (fw): Select all Collapse
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
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Say update problem
Posted: Mon Jun 20, 2016 01:59 PM
Code (fw): Select all Collapse
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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Say update problem
Posted: Mon Jun 20, 2016 02: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
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: Say update problem
Posted: Mon Jun 20, 2016 05:16 PM
Francisco, James,

This working fine
Code (fw): Select all Collapse
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 (fw): Select all Collapse
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

Continue the discussion