Hi

Przemyslaw Czerpak-2 wrote:
> 
> Here is a difference between xbase++ and Harbour. XbpComboBox() is
> class function. In xbase++ just like in Class(y) class functions return
> class object not the object of given class. It's necessary to send
> new() message to this object to create new object of XbpComboBox class.
> So in xbase++ above code should look like:
>    oCombo := XbpComboBox():new( ... )
> 

Yes, I know, the code written above was a result of fastness :-(



> XbpSLE is cast message. It returns special pseudo object which
> causes that any message send to it will be taken from XbpSLE
> class but sent to original oCombo object. It's usable when you
> have methods or instance variables with the same name in few
> different ancestor classes and you want to chose the one which
> belongs to exactly given class. If there is no name conflict then:
>    oCombo:xbpSLE:callSomeFunOrProperty()
> should have the same behavior as:
>    oCombo:callSomeFunOrProperty()
> Messages are sent from left to right so this code:
>    (oCombo:xbpSLE):callSomeFunOrProperty()
> has the same meaning.
> 

XbpSLE is cast message. It returns special pseudo object 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

How I can retrieve this pseudo object?

I need value of a property in the XbpComboBox():new() itself
of the instance respresenting XbpSLE().

Now I have resolved it like this ( not an elegant solution )

*******************************************

CLASS XbpComboBox  INHERIT  XbpSLE, XbpListBox

   DATA     type                                  INIT    XBPCOMBO_DROPDOWN
   ........

   DATA     oSLE
   ACCESS   XbpSLE                                INLINE  ::oSLE
   DATA     oLB
   ACCESS   XbpListBox                            INLINE  ::oLB

   ENDCLASS


METHOD XbpComboBox:create( oParent, oOwner, aPos, aSize, aPresParams,
lVisible )
   ::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )

   ::oSLE := XbpSLE():new():create( oParent, oOwner, aPos, aSize,
aPresParams, lVisible )
   ::oLB  := XbpListBox():new():create( oParent, oOwner, aPos, aSize,
aPresParams, lVisible )

   ::oWidget := QComboBox():New( ::pParent )

   vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

   ::oWidget:setLineEdit( ::XbpSLE:oWidget:pPtr ) 
   ::oWidget:setEditable( ::XbpSLE:editable )
   ::oWidget:setFrame( ::XbpSLE:border )

   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  Where I need XbpSLE's instance

   ::connect( ::pWidget, "highlighted(int)"        , {|o,i| ::exeBlock(
1,i,o ) } )
   ::connect( ::pWidget, "currentIndexChanged(int)", {|o,i| ::exeBlock(
2,i,o ) } )

   ::setPosAndSize()
   IF ::visible
      ::show()
   ENDIF
   ::oParent:AddChild( SELF )
   RETURN Self

*******************************************


> I do not know I answered to your question but I hope it helps.

Yes, it helped to understand class basics, as ever. Thanks.

Regards
Pritpal Bedi
-- 
View this message in context: 
http://www.nabble.com/CLASSES---What-this-mean---tp24131028p24132664.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.

_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to