Author | Topic: XbpPushButton:activate() | |
---|---|---|
Carlos a Beling | XbpPushButton:activate() on Fri, 21 Sep 2018 11:23:09 -0300 Hello. Good morning. How can I get in a XbpPushButton subclass the window that had focus before XbpButton:activate (call back or method) be executed? Fraternally Beling | |
Itai Ben-Artzi | Re: XbpPushButton:activate() on Sat, 29 Sep 2018 14:11:36 -0700 Carlos, Use the :SetParent() method in a loop till the parent window is retrieved. | |
Carlos a Beling | Re: XbpPushButton:activate() on Mon, 01 Oct 2018 13:31:56 -0300 Hello Itai. Good afternoon. Many thanks. The focus could to be, in example in a XbpSle() where I would like to set the focus back. Fraternally Beling Em 29/09/2018 18:11, Itai Ben-Artzi escreveu: > Carlos, > Use the :SetParent() method in a loop till the parent window is > retrieved. > | |
Jose Antonio Diego Kereje | Re: XbpPushButton:activate() on Mon, 01 Oct 2018 21:24:38 +0200 Carlos, Although I'm not sure what you want to do, this could be a way to solve it. Regards. Diego PROCEDURE MyProcedure ********************** LOCAL oXbpLastFocus:= nil XbpDialog():new():create().... oXbp:= XbpSle():new() oXbp:setInputFocus:= {|u1, u2, obj| oXbpLastFocus:= obj } oXbp:cargo:= 'Id1' oXbp:create( oDlg:drawingArea... oXbp:= XbpSle():new() oXbp:setInputFocus:= {|u1, u2, obj| oXbpLastFocus:= obj } oXbp:cargo:= 'Id2' oXbp:create( oDlg:drawingArea... oXbp:= XbpComboBox():new() oXbp:setInputFocus:= {|u1, u2, obj| oXbpLastFocus:= obj } oXbp:cargo:= 'Id3' oXbp:create( oDlg:drawingArea... .... oXbp:= XbpPushButton():new() oXbp:activate:= {|| Validate( oXbpLastFocus ) } oXbp:create( oDlg:drawingArea... do while .... enddo RETURN PROCEDURE Validate( oXbpLastFocus ) ******************************** IF oXbpLastFocus = nil Bla, bla, bla... ELSEIF oXbpLastFocus:cargo = 'Id1' .AND. .NOT. bla, bla, bla SetAppFocus( oXbpLastFocus ) ELSEIF oXbpLastFocus:cargo = 'Id2' .AND. .NOT. bla, bla, bla SetAppFocus( oXbpLastFocus ) ELSE Bla, bla, bla.... ENDIF RETURN "Carlos a Beling" escribió en el mensaje de noticias:7cf1907$a10e6$39a1b@news.alaska-software.com... Hello Itai. Good afternoon. Many thanks. The focus could to be, in example in a XbpSle() where I would like to set the focus back. Fraternally Beling Em 29/09/2018 18:11, Itai Ben-Artzi escreveu: > Carlos, > Use the :SetParent() method in a loop till the parent window is > retrieved. > | |
Carlos a Beling | Re: XbpPushButton:activate() on Mon, 01 Oct 2018 18:19:23 -0300 Hello Diego. Good night. Many Thanks. What I want is to set the focus back to the window that had it after the execution of the :activate() method. Fraternally Beling Em 01/10/2018 16:24, Jose Antonio Diego Kereje escreveu: > Carlos, > > Although I'm not sure what you want to do, this could be a way to solve it. > > Regards. Diego > > PROCEDURE MyProcedure > ********************** > LOCAL oXbpLastFocus:= nil > > XbpDialog():new():create().... > > oXbp:= XbpSle():new() > oXbp:setInputFocus:= {|u1, u2, obj| oXbpLastFocus:= obj } > oXbp:cargo:= 'Id1' > oXbp:create( oDlg:drawingArea... > > oXbp:= XbpSle():new() > oXbp:setInputFocus:= {|u1, u2, obj| oXbpLastFocus:= obj } > oXbp:cargo:= 'Id2' > oXbp:create( oDlg:drawingArea... > > oXbp:= XbpComboBox():new() > oXbp:setInputFocus:= {|u1, u2, obj| oXbpLastFocus:= obj } > oXbp:cargo:= 'Id3' > oXbp:create( oDlg:drawingArea... > > .... > > oXbp:= XbpPushButton():new() > oXbp:activate:= {|| Validate( oXbpLastFocus ) } > oXbp:create( oDlg:drawingArea... > > do while .... > enddo > RETURN > > PROCEDURE Validate( oXbpLastFocus ) > ******************************** > IF oXbpLastFocus = nil > Bla, bla, bla... > ELSEIF oXbpLastFocus:cargo = 'Id1' .AND. .NOT. bla, bla, bla > SetAppFocus( oXbpLastFocus ) > ELSEIF oXbpLastFocus:cargo = 'Id2' .AND. .NOT. bla, bla, bla > SetAppFocus( oXbpLastFocus ) > ELSE > Bla, bla, bla.... > ENDIF > RETURN > > > > > > > > > > "Carlos a Beling" escribió en el mensaje de > noticias:7cf1907$a10e6$39a1b@news.alaska-software.com... > > Hello Itai. > Good afternoon. > Many thanks. > The focus could to be, in example in a XbpSle() where I would like to > set the focus back. > > Fraternally > Beling > > Em 29/09/2018 18:11, Itai Ben-Artzi escreveu: >> Carlos, >> Use the :SetParent() method in a loop till the parent window is >> retrieved. >> > | |
Peter Alderliesten | Re: XbpPushButton:activate() on Tue, 02 Oct 2018 14:43:54 +0200 Beling, > What I want is to set the focus back to the window that had it after the > execution of the :activate() method. Save the object (with setAppFocus()) before activating the button and, reset it after... Peter | |
Carlos a Beling | Re: XbpPushButton:activate() on Tue, 02 Oct 2018 11:32:49 -0300 Hello Peter. Many thanks. The problem that I am having is that when the method :activate() is executed the pushbutton has already the focus. Am I right? Fraternally Beling Em 02/10/2018 09:43, Peter Alderliesten escreveu: > Beling, > >> What I want is to set the focus back to the window that had it after the >> execution of the :activate() method. > > Save the object (with setAppFocus()) before activating the button and, > reset it after... > > Peter > | |
Carlos a Beling | Re: XbpPushButton:activate() Correction on Mon, 01 Oct 2018 18:23:58 -0300 Hello Diego. Good night. Many Thanks. What I want is to set the focus back to the window that had it before the execution of the :activate() method. Fraternally Beling Em 01/10/2018 16:24, Jose Antonio Diego Kereje escreveu: > Carlos, > > Although I'm not sure what you want to do, this could be a way to solve it. > > Regards. Diego > > PROCEDURE MyProcedure > ********************** > LOCAL oXbpLastFocus:= nil > > XbpDialog():new():create().... > > oXbp:= XbpSle():new() > oXbp:setInputFocus:= {|u1, u2, obj| oXbpLastFocus:= obj } > oXbp:cargo:= 'Id1' > oXbp:create( oDlg:drawingArea... > > oXbp:= XbpSle():new() > oXbp:setInputFocus:= {|u1, u2, obj| oXbpLastFocus:= obj } > oXbp:cargo:= 'Id2' > oXbp:create( oDlg:drawingArea... > > oXbp:= XbpComboBox():new() > oXbp:setInputFocus:= {|u1, u2, obj| oXbpLastFocus:= obj } > oXbp:cargo:= 'Id3' > oXbp:create( oDlg:drawingArea... > > .... > > oXbp:= XbpPushButton():new() > oXbp:activate:= {|| Validate( oXbpLastFocus ) } > oXbp:create( oDlg:drawingArea... > > do while .... > enddo > RETURN > > PROCEDURE Validate( oXbpLastFocus ) > ******************************** > IF oXbpLastFocus = nil > Bla, bla, bla... > ELSEIF oXbpLastFocus:cargo = 'Id1' .AND. .NOT. bla, bla, bla > SetAppFocus( oXbpLastFocus ) > ELSEIF oXbpLastFocus:cargo = 'Id2' .AND. .NOT. bla, bla, bla > SetAppFocus( oXbpLastFocus ) > ELSE > Bla, bla, bla.... > ENDIF > RETURN > > > > > > > > > > "Carlos a Beling" escribió en el mensaje de > noticias:7cf1907$a10e6$39a1b@news.alaska-software.com... > > Hello Itai. > Good afternoon. > Many thanks. > The focus could to be, in example in a XbpSle() where I would like to > set the focus back. > > Fraternally > Beling > > Em 29/09/2018 18:11, Itai Ben-Artzi escreveu: >> Carlos, >> Use the :SetParent() method in a loop till the parent window is >> retrieved. >> > | |
Jim Lee | Re: XbpPushButton:activate() on Tue, 02 Oct 2018 23:21:45 +0200 > How can I get in a XbpPushButton subclass the window that had focus before > XbpButton:activate (call back or method) be executed? when you click on Bottun to o:activate a Callback Slot it is just EVAL(Codeblock) you can't have a Action BEFORE you click on a Button ... there is no KI to find out what you want to do util you did. in your Codebock you can call many Function like bBlock := { |u1,u2,oSelf| oLastDlg := oSelf:SetParent(),; oLastSLE := oSelf,; Do_My_work(),; SetAppWindow(oLastDlg),; SetAppFocus(oLastSLE) } neverless : what exact do you want to do ? | |
Carlos a Beling | Re: XbpPushButton:activate() on Wed, 03 Oct 2018 10:45:21 -0300 Hello Jim: good morning. Many thanks. I think that I got gthe problem's solution: CLASS MyPushButton ... EXPORTED: VAR ::oHadFocus ... INLINE METHOD enter(...) ::oHadFocus := SetAppFocus() RETURN Self INLINE METHOD activate() Eval(::activate) SetAppFocus(::oHadFocus) RETURN Self ... ENDCLASS PROCEDURE MAIN() LOCAL oPushButton oPushButton := MyPushButton():new(...) oPushButton:activate := {|| ...} oPushButton:create() RETURN Fraternally Beling Em 02/10/2018 18:21, Jim Lee escreveu: >> How can I get in a XbpPushButton subclass the window that had focus before >> XbpButton:activate (call back or method) be executed? > > when you click on Bottun to o:activate a Callback Slot it is just > EVAL(Codeblock) > you can't have a Action BEFORE you click on a Button ... there is no KI to > find out what you want to do util you did. > > in your Codebock you can call many Function like > > bBlock := { |u1,u2,oSelf| oLastDlg := oSelf:SetParent(),; > oLastSLE := oSelf,; > Do_My_work(),; > SetAppWindow(oLastDlg),; > SetAppFocus(oLastSLE) } > > neverless : what exact do you want to do ? > > |