Template:DGS/OOP

From Multi Theft Auto: Wiki
Revision as of 20:11, 15 April 2021 by Lettify (talk | contribs) (DGS OOP Syntax Mission)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Applications-office.pngTemplate Documentation

Template for OOP (object orientated programming)

Usage

Syntax

{{OOP|NOTE|METHOD|EVENT|VARIABLE|COUNTERPART|ELEMENT_TYPE|ELEMENT_NAME}}

For functions

OOP Syntax Help! I don't understand this!

Note: This function creates a 3d interface in the world.
Method: dgs3DInterface(...)


{{OOP|This function creates a 3d interface in the world.|dgs3DInterface||}}


OOP Syntax Help! I don't understand this!

Method: DGSElement:setText(...)
Counterpart: text


{{OOP||DGSElement:setText||text|dgsGetText}}


OOP Syntax Help! I don't understand this!

Note: This function is used to create columns in grid lists.
Method: addColumn(...)


{{OOP|This function is used to create columns in grid lists.|addColumn|||dgsGridListRemoveColumn|dgs-dxgridlist|GridList}}

For events

OOP Syntax Help! I don't understand this!

Note: This event is triggered each time a DGS element gains input focus
Variable: .dgsFocus


{{OOP|This event is triggered each time a DGS element gains input focus||dgsFocus}}


OOP Syntax Help! I don't understand this!

Note: This event is triggered when enter is pressed on a dgs edit box.
Variable: .dgsEditAccepted


{{OOP|This event is triggered when enter is pressed on a dgs edit box.||dgsEditAccepted|||dgs-dxedit|DGSEditBox}}

Hey guys, here are a few "rules" in using the OOP template:

  • If it's a constructor, such as createPed, use "Ped" not "createPed" or "Ped.create"
  • If it's a static class function or a constructor, use a capital letter for the first character. (Player not player).
  • Likewise, if it's an object function such as "player:setName", use lowercase.
  • Use full stops (or if you're american, "periods.") for static functions and colons (:) for object functions.