Author | Topic: METHOD ... IS ... IN ... | |
---|---|---|
Carlos Beling | METHOD ... IS ... IN ... on Fri, 25 Aug 2023 19:12:17 -0300 Good night. I was trying to use the METHOD declaration according to the attached example and I could not to make it works. Please can anyone help me making it work (if possible)? Fraternally Beling Test.zip | |
Andreas Gehrs-Pahl | Re: METHOD ... IS ... IN ... on Sun, 27 Aug 2023 19:18:12 -0400 Carlos, >I was trying to use the METHOD declaration according to the attached >example and I could not to make it works. >Please can anyone help me making it work (if possible)? I have no idea what you are trying to do with this, but you are creating a class based on XbpDialog and XbpStatic, which seems weird, as they are both based on the XbpWindow class. Then you add an iVar named oDlg to your object that contains another, additional, XbpDialog object, which you initialize in the :Init() method, create in the :Create() method, and finally destroy in the :Destroy() method. But you never initialize, create or destroy your Test object, or Self, so you get an error when you try to call a method -- :Show() -- of it. I suggest you remove the :oDlg object and use only Self instead. Class Test from XbpDialog, XbpStatic Exported: Method Show is Show in XbpDialog Inline Method Init() Super:Init(AppDesktop(), NIL, NIL, {800, 600}, NIL, .f.) ::Title := 'Testing Purpose' return (Self) Inline Method Create() Super CenterControl(Self) return (Self) Inline Method Detroy() Super return (Self) EndClass Still don't know what you are trying to do with such a class, though. Andreas Andreas Gehrs-Pahl Absolute Software, LLC phone: (989) 723-9927 email: Andreas@AbsoluteSoftwareLLC.com web: http://www.AbsoluteSoftwareLLC.com [L]: https://www.LinkedIn.com/in/AndreasGehrsPahl [F]: https://www.FaceBook.com/AbsoluteSoftwareLLC | |
Carlos Beling | Re: METHOD ... IS ... IN ... on Mon, 28 Aug 2023 16:49:21 -0300 Hi Andreas. Good day. Many thanks again. What I want to do is to create a XbpBrowse() class encapsulated in a XbpDialog() where I use XbpDialog():menubar(), I add a tool bar and a XbpStatic() that shows the description of the current stabilized line of xbpbrowse(). IE the method :show() and others must to be executed in XbpDialog() for avoiding partial rendering of the class. Fraternally Beling Em 27/08/2023 20:18, Andreas Gehrs-Pahl escreveu: > Carlos, > >> I was trying to use the METHOD declaration according to the attached >> example and I could not to make it works. >> Please can anyone help me making it work (if possible)? > > I have no idea what you are trying to do with this, but you are creating a > class based on XbpDialog and XbpStatic, which seems weird, as they are both > based on the XbpWindow class. Then you add an iVar named oDlg to your object > that contains another, additional, XbpDialog object, which you initialize in > the :Init() method, create in the :Create() method, and finally destroy in > the :Destroy() method. > > But you never initialize, create or destroy your Test object, or Self, so > you get an error when you try to call a method -- :Show() -- of it. > > I suggest you remove the :oDlg object and use only Self instead. > > Class Test from XbpDialog, XbpStatic > Exported: > Method Show is Show in XbpDialog > > Inline Method Init() > Super:Init(AppDesktop(), NIL, NIL, {800, 600}, NIL, .f.) > ::Title := 'Testing Purpose' > return (Self) > > Inline Method Create() > Super > CenterControl(Self) > return (Self) > > Inline Method Detroy() > Super > return (Self) > EndClass > > Still don't know what you are trying to do with such a class, though. > > Andreas | |
Slavoljub Damnjanovic | Re: METHOD ... IS ... IN ... on Mon, 02 Oct 2023 11:11:24 +0200 >I was trying to use the METHOD declaration according to the attached >example and I could not to make it works. >Please can anyone help me making it work (if possible)? METHOD SHOW IS show IN XbpDialog This is wrong since show() is method of XbpWindow and not XbpDialog. The message error says that its not registered and that is true. Use the following code, it works. INLINE METHOD show() ::oDlg:show() RETURN self Regards | |
Carlos Beling | Re: METHOD ... IS ... IN ... on Mon, 02 Oct 2023 12:03:10 -0300 Hi Slavoljub: good day. Many, many thnks. Fraternally Beling Em 02/10/2023 06:11, Slavoljub Damnjanovic escreveu: >> I was trying to use the METHOD declaration according to the attached >> example and I could not to make it works. >> Please can anyone help me making it work (if possible)? > > METHOD SHOW IS show IN XbpDialog > > This is wrong since show() is method of XbpWindow and not XbpDialog. The > message error says that its not registered and that is true. Use the following > code, it works. > > INLINE METHOD show() > ::oDlg:show() > RETURN self > > Regards |