FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ::Refresh() needed in TMultiGet's ::GotFocus(),::LostFocus()
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
::Refresh() needed in TMultiGet's ::GotFocus(),::LostFocus()
Posted: Mon Jul 31, 2006 03:13 AM

Mr.Antonio

The GotFocus() functionality for TMultiGet class was not working properly
until I have added a ::Refresh() clause in GotFocus() and LostFocus()
methods in TMGet.prg. After adding ::Refresh() clasuse only the
expected functionality is achived.

I am using FWH 2.7 July Build & xHarbour 0.99.61.

This is for your information

  • Ramesh Babu P

// Testing a GET

include "FiveWin.ch"

//------------------------------------------------------------------------//

function Main()

local oDlg
local dDay := Date(), cNotes
local oGet, oGet1

SET DATE BRIT
SET CENT ON

DEFINE DIALOG oDlg TITLE "Testing GotFocus() Clause of TMultiGet Class"

@ 0.50, 2 SAY "Date:" OF oDlg
@ 0.50, 6 GET oGet VAR dDay OF oDlg SIZE 23, 10 SPINNER ;
VALID ! Empty( dDay ) ;
COLORS nRGB( 0, 0, 0 ), nRGB( 224, 224, 249 )

@ 2.00, 2 SAY "Notes:" OF oDlg
@ 2.00, 6 GET oGet1 VAR cNotes OF oDlg SIZE 100, 25 MEMO;
COLORS nRGB( 0, 0, 0 ), nRGB( 224, 224, 249 )

@ 3.25, 7 BUTTON "&Ok" OF oDlg SIZE 30, 12 ACTION oDlg:End()
@ 3.25,16 BUTTON "&Cancel" SIZE 30, 12 OF oDlg ACTION oDlg:End() CANCEL

oGet:bGotFocus := { || oGet:SetColor(nRGB(255,255,255), nRGB(64,0,255)) }
oGet1:bGotFocus := { || oGet1:SetColor(nRGB(255,255,255), nRGB(64,0,255)), oGet1:Refresh() } // For demonstration I have added oGet1:Refresh() here
oGet1:bLostFocus := { || oGet1:SetColor(nRGB(0,0,0), nRGB(224,224,249)), oGet1:Refresh() } // For demonstration I have added oGet1:Refresh() here

ACTIVATE DIALOG oDlg CENTERED

RETURN nil

//------------------------------------------------------------------------//

procedure AppSys // Xbase++ requirement

return

//------------------------------------------------------------------------//

ifdef XPP

#define GetNew _GetNew

endif

ifndef CLIPPER

CLASS TClipGet FROM Get

METHOD Display() VIRTUAL

ENDCLASS

//---------------------------------------------------------------------------//

function GetNew( nRow, nCol, bVarBlock, cVarName, cPicture, cColor )

return TClipGet():New( nRow, nCol, bVarBlock, cVarName, cPicture, cColor )

//---------------------------------------------------------------------------//

endif

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
::Refresh() needed in TMultiGet's ::GotFocus(),::LostFocus()
Posted: Mon Jul 31, 2006 06:49 AM

Ramesh,

Yes, it is needed as you are changing the colors so you need to request a repaint of the control.

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion