Class TMultiGet - Focus Color

Class TMultiGet - Focus Color

Postby Jeff Barnes » Thu Feb 14, 2013 1:08 am

Hi,

With a regular get I can set the focus color with:
oGet:SetGetColorFocus( RGB(152,251,152) )

How can I do this with a multiget? Is it possible?
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Class TMultiGet - Focus Color

Postby ukoenig » Thu Feb 14, 2013 1:00 pm

Jeff,
it is a little bit tricky.
I noticed ( with a alert ) during reading the lines in a multiline get,
the focus status changed for each line from focus to lost focus.
Maybe a bug ?

see what happens, changing these lines of the multiline get inside the working function to :

@ 3, 10 GET oGet1 VAR cVar OF oDlg SIZE 95, 30 MULTILINE
oGet1:bGotFocus := {|| MsgAlert( "Got Focus" ), oGet1:SetColor( , 11251710 ), oGet1:Refresh() }
oGet1:bLostFocus := {|| MsgAlert( "Lost Focus" ), oGet1:SetColor( , 15973519 ), oGet1:Refresh() }


I got it working like :

Image

function Main()
Local oGet1, oGet2, lFocus1 := .F.
local cVar:="lalalalala",cVar1:="hoplalalalala"

DEFINE DIALOG oDlg FROM 1,10 TO 24,60

@ 1, 12 BUTTON "&End" OF oDlg ACTION oDlg:end()

// only read focus status once !!!
// ---------------------
@ 3, 10 GET oGet1 VAR cVar OF oDlg SIZE 95, 30 MULTILINE
oGet1:bGotFocus := {|| lFocus1 := .T.,;
IIF( lFocus1 = .T., oGet1:SetColor( , 11251710 ), NIL ), oGet1:Refresh() }


oGet1:bLostFocus := {|| lFocus1 := .F.,;
oGet1:SetColor( , 15973519 ), oGet1:Refresh() }


@ 8, 10 GET oGet2 VAR cVar1 OF oDlg SIZE 95, 15

ACTIVATE DIALOG oDlg

return NIL

Best Regards
Uwe :roll:
Last edited by ukoenig on Thu Feb 14, 2013 1:22 pm, edited 5 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Class TMultiGet - Focus Color

Postby Jeff Barnes » Thu Feb 14, 2013 1:15 pm

Thank you Uwe ... Works perfectly :D
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada


Return to FiveWin for Harbour/xHarbour

Who is online

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