Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #10604

Re: Rookie question about focus and buttons

From Franz Rachbauer <office@rachbauer.org>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Rookie question about focus and buttons
Date 2017-05-24 13:13 +0200
Organization Aioe.org NNTP Server
Message-ID <og3psn$fts$1@gioia.aioe.org> (permalink)
References <1d99e068-2fc5-4c12-9610-5de6bcd4cbc9@googlegroups.com> <eoklu7FeulaU1@mid.individual.net> <a37f0fc2-de26-45f7-93a1-c3d34e8aa52e@googlegroups.com>

Show all headers | View raw


On the fly (simple):
//-----------------------------------------//
CLASS MyPushButton INHERIT PushButton
EXPORT _oSle AS SingleLineEdit

METHOD LinkSleToButton(oSle) CLASS MyPushButton
_oSle := oSle	// save Sle at button
RETURN SELF
//-----------------------------------------//
METHOD ButtonClick(oCE) CLASS dtaMain
IF oCE:Control:NameSym == #pshFillSle	// identify the button(s)
	oCE:Control:_oSle:TextValue := "XYZ"
	oCE:Control:_oSle:SetFocus()
ENDIF
RETURN SUPER:ButtonClick(oCE)

METHOD PostInit() CLASS dtaMain
oCCpshFillSle:LinkSleToButton(oDCSleFillSle)
RETURN SELF
//----------------------------------------//

The button pshFillSle has to be inherited from MyPushButton in designer. 
I think thats one way Wolfgang ment.

Regards Franz

Am 24.05.2017 um 12:23 schrieb stuart.mcalpine@ymail.com:
> On Wednesday, 24 May 2017 07:01:45 UTC+1, Wolfgang Riedmann  wrote:
>> Hi Stu,
>>
>>> I've got a small app that I'm migrating to touchscreen.  I have a few
>>> SLE and have created large buttons for input into the SLE.
>>>
>>> Dumb question I know, but how do I return focus to the appropriate
>>> SLE after the button is clicked?
>>>
>>> I can't seem to suss out how to determine where to return focus to.
>>
>> declare an own class for the pushbutton and put a reference of the
>> correct SLE to the pushbutton class. After the button click, you can
>> retrieve the SLE object from the pressed pushbutton and set the focus
>> there.
>>
>> Wolfgang
>>
>>
>>
>> --
>
> Hi Wolfgang
>
> Many thanks.  That's exactly what I'm trying to achieve.
>
> I couldn't trouble you to reference a short example of code?
>
> Many thanks again.
>

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Rookie question about focus and buttons Stu <stuart.mcalpine@ymail.com> - 2017-05-23 07:25 -0700
  Re: Rookie question about focus and buttons Franz Rachbauer <office@rachbauer.org> - 2017-05-23 16:32 +0200
  Re: Rookie question about focus and buttons "Wolfgang Riedmann" <wriedmann@gmail.com> - 2017-05-24 08:01 +0200
    Re: Rookie question about focus and buttons stuart.mcalpine@ymail.com - 2017-05-24 03:23 -0700
      Re: Rookie question about focus and buttons Franz Rachbauer <office@rachbauer.org> - 2017-05-24 13:13 +0200
        Re: Rookie question about focus and buttons Stu <stuart.mcalpine@ymail.com> - 2017-05-25 01:18 -0700
  Re: Rookie question about focus and buttons Karl Wochele <kw@ecos-system.invalid> - 2017-06-06 07:44 +0200

csiph-web