FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Difference between oGet and osay (Appersand)
Posts: 55
Joined: Fri Jul 08, 2011 06:43 AM
Difference between oGet and osay (Appersand)
Posted: Sun Jul 31, 2011 07:54 AM
Hello,

Dispaying a text as "Test&Test" gives a difference betseen a get and a say (Absurd !!!!!!)

See the example , you can test with activating or not TEST1 or TEST2

I don't understand the diference between varput in oGet and osay , followed by refresh() :

In both cases bSetget is executed and at the end from the process SetWindowText( ::hWnd, cTxt )

Code (fw): Select all Collapse
# define TEST1   // Desactivate to test without init test()
//# define TEST2   // To Correct the display from appersands in a say object
#include "FiveWin.ch"

function Main()
***************
   local oDlg, oSay, oGet
     local ctxt := PAD("Test&Test&test&",25)
   DEFINE DIALOG oDlg

   @ 2, 2 SAY oSay PROMPT cTxt
   @ 4, 2 GET oGet VAR cTxt

     # ifdef TEST1
     ACTIVATE DIALOG oDlg CENTERED  ON INIT Test(oSay , oGet ) //( SetWindowText( oSay:hWnd, Tst(cTxt) )   )
     # else
     ACTIVATE DIALOG oDlg CENTERED  // ON INIT Test(oSay , oGet ) //( SetWindowText( oSay:hWnd, Tst(cTxt) )   )
     # endif

return nil

FUNC ConvertAppersandToSay(cTxt)
*******************************
IF "&" IN cTxt
     cTxt := AtRepl("&" , cTxt , "&&")
END
RETURN cTxt

PROC Test(oSay , oGet)
**********************
# ifdef TEST2
oSay:Varput(ConvertAppersandToSay("VarputinSay&VarputinSay&"))
# else
oSay:Varput("VarputinSay&VarputinSay&")
# endif
oSay:Refresh()
oGet:Varput("VarputinGet&VarputinGet&")
oGet:Refresh()
RETURN


Frank
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Difference between oGet and osay (Appersand)
Posted: Sun Jul 31, 2011 08:20 AM

It is an expected Windows API behavior. The ampersand means the underlined character that can be pressed with CTRL to select the control. It doesn't mean that we cannot found a solution, though. The problem, as usual, is the backward compatibility...

EMG

Continue the discussion