Gracias José.
Att.
Cassiano.
"José Lalín" wrote in message news:525d534a$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
Cassiano,
the better place to learn are the sources.
> Hello guys i want know if have some tutorial to use class, because i don´t
> understand very well, for example, when i use:
>
> PUBLISHED EXPORTED PROTECT, etc
PUBLISHED: are the properties visible outside the class and they
appear in the object inspector.
PUBLIC: are properties visible outside the class but doesn't appear in the
object inspector.
PROTECTED/PRIVATE: properties/datas/methods are visible only inside the
class.
> What´s difference between PROPERTY and DATA
PROPERTY allows to customize the behaviour of the property with custom
editors (by example: PE_Color) whilst DATA no.
> This and more asks that i want know to create a controls in Xailer too.
Did you seen these two little tutorials:
http://xailer.info/esp/?p=132
http://xailer.info/esp/?p=165
> I studied the Metacontrols, Controls Sample and bought the Jose Alfonso
The metacontrols is a special kind of control: it is not a real control but
a way to customize them without the needing to modify its sources.
Lets think about a standar TButton, every time you drop one in a form you
have to change its text, ie., to "Aceitar", set lDefault to true,
nModalResul to mrOKm, etc. to sweet your needs. You can write a metacontrol
to do this steps automatically.
Here is a complete sample:
//---------------------------------------------------------- --------------------
INIT PROC RegisterAceitarButton()
RegisterComponent( "Cassiano", "TButton", "TAceitarButton", {||
TAceitarButton():Create() } )
RETURN
//---------------------------------------------------------- --------------------
CLASS TAceitarButton FROM TIDEMetaControl
METHOD Create()
ENDCLASS
//---------------------------------------------------------- --------------------
METHOD Create() CLASS TAceitarButton
LOCAL oBtn
LOCAL aPos := GetCursorPos()
IF ::oActiveForm == Nil
RETURN Nil
ENDIF
aPos := ScreenToClient( ::oActiveForm:Handle, aPos )
WITH OBJECT oBtn := ::AddComponent( TButton(), ::oActiveForm )
:nLeft := aPos[1]
:nTop := aPos[2]
:lDefault := .T.
:cText := "&Aceitar"
:nModalResult := mrOK
//:nWidth := ...
END
::SetControl( oBtn )
RETURN Nil
//---------------------------------------------------------- --------------------
If you compile this code as a DLL and load it with Components->Component
manager->Add you will have a custom TButton in the "Cassiano" tab.
Regards,
José Lalín