DGS OOP Class: Difference between revisions
Jump to navigation
Jump to search
Line 374: | Line 374: | ||
===3D Interface=== | ===3D Interface=== | ||
{| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | {| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | ||
|- | |||
|getBlendMode | |getBlendMode | ||
|[[dgs3DInterfaceGetBlendMode]] | |[[dgs3DInterfaceGetBlendMode]] | ||
Line 422: | Line 423: | ||
===Arrow List=== | ===Arrow List=== | ||
{| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | {| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | ||
|- | |||
|addItem | |addItem | ||
|[[dgsArrowListAddItem]] | |[[dgsArrowListAddItem]] | ||
Line 467: | Line 469: | ||
===Check Box=== | ===Check Box=== | ||
{| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | {| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | ||
|- | |||
|getSelected | |getSelected | ||
|[[dgsCheckBoxGetSelected]] | |[[dgsCheckBoxGetSelected]] | ||
Line 476: | Line 479: | ||
===Radio Button=== | ===Radio Button=== | ||
{| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | {| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | ||
|- | |||
|getSelected | |getSelected | ||
|[[dgsRadioButtonGetSelected]] | |[[dgsRadioButtonGetSelected]] | ||
Line 485: | Line 489: | ||
===Combo Box=== | ===Combo Box=== | ||
{| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | {| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | ||
|- | |||
|addItem | |addItem | ||
|[[dgsComboBoxAddItem]] | |[[dgsComboBoxAddItem]] | ||
Line 542: | Line 547: | ||
===Edit=== | ===Edit=== | ||
{| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | {| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | ||
|- | |||
|moveCaret | |moveCaret | ||
|[[dgsEditMoveCaret]] | |[[dgsEditMoveCaret]] | ||
Line 614: | Line 620: | ||
===Ellipse Detect Area=== | ===Ellipse Detect Area=== | ||
{| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | {| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | ||
|- | |||
|setDebugModeEnabled | |setDebugModeEnabled | ||
|[[dgsEDASetDebugModeEnabled]] | |[[dgsEDASetDebugModeEnabled]] | ||
Line 623: | Line 630: | ||
===Detect Area=== | ===Detect Area=== | ||
{| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | {| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | ||
|- | |||
|setFunction | |setFunction | ||
|[[dgsDetectAreaSetFunction]] | |[[dgsDetectAreaSetFunction]] | ||
Line 629: | Line 637: | ||
===Grid List=== | ===Grid List=== | ||
{| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | {| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | ||
|- | |||
|getScrollBar | |getScrollBar | ||
|[[dgsGridListGetScrollBar]] | |[[dgsGridListGetScrollBar]] | ||
Line 791: | Line 800: | ||
===Image=== | ===Image=== | ||
{| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | {| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | ||
|- | |||
|setImage | |setImage | ||
|[[dgsImageSetImage]] | |[[dgsImageSetImage]] | ||
Line 812: | Line 822: | ||
===dgs-dxmemo=== | ===dgs-dxmemo=== | ||
{| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | {| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | ||
|- | |||
|moveCaret | |moveCaret | ||
|[[dgsMemoMoveCaret]] | |[[dgsMemoMoveCaret]] | ||
Line 860: | Line 871: | ||
===Label=== | ===Label=== | ||
{| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | {| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | ||
|- | |||
|setColor | |setColor | ||
|[[dgsLabelSetColor]] | |[[dgsLabelSetColor]] | ||
Line 881: | Line 893: | ||
===dgs-dxprogressbar=== | ===dgs-dxprogressbar=== | ||
{| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | {| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | ||
|- | |||
|getProgress | |getProgress | ||
|[[dgsProgressBarGetProgress]] | |[[dgsProgressBarGetProgress]] | ||
Line 908: | Line 921: | ||
===Scroll Bar=== | ===Scroll Bar=== | ||
{| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | {| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | ||
|- | |||
|setScrollPosition | |setScrollPosition | ||
|[[dgsScrollBarSetScrollPosition]] | |[[dgsScrollBarSetScrollPosition]] | ||
Line 929: | Line 943: | ||
===dgs-dxscrollpane=== | ===dgs-dxscrollpane=== | ||
{| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | {| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | ||
|- | |||
|getScrollBar | |getScrollBar | ||
|[[dgsScrollPaneGetScrollBar]] | |[[dgsScrollPaneGetScrollBar]] | ||
Line 947: | Line 962: | ||
===Switch Button=== | ===Switch Button=== | ||
{| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | {| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | ||
|- | |||
|getState | |getState | ||
|[[dgsSwitchButtonGetState]] | |[[dgsSwitchButtonGetState]] | ||
Line 961: | Line 977: | ||
===Tab Panel=== | ===Tab Panel=== | ||
{| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | {| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | ||
|- | |||
|getSelectedTab | |getSelectedTab | ||
|[[dgsGetSelectedTab]] | |[[dgsGetSelectedTab]] | ||
Line 982: | Line 999: | ||
===Tab=== | ===Tab=== | ||
{| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | {| class="wikitable" style="width: 800px; text-align: center; table-layout: fixed;" | ||
|- | |||
|deleteTab | |deleteTab | ||
|[[dgsDeleteTab]] | |[[dgsDeleteTab]] | ||
|- | |- | ||
|} | |} |
Revision as of 05:40, 29 January 2019
DGS provides not only POP ( Procedure Oriented Programming ) but also OOP ( Object Oriented Programming ). This page introduces OOP of dgs.
Structure
When using DGS OOP, DGS objects to be operated are no longer elements, instead, they will be tables ( table is the only type whose call methods can be defined in lua ) . Here is the structure of DGS OOP Object:
DGSDxObject = { DGSElement = DGSElement -- The actual dgs element function1, function2, ... }
- The built-in functions are non-modifiable
- Any variable of the table are get/set via dgsSetProperty/dgsGetProperty ( Exclude DGSElement )
- After importing DGS OOP Class, there is a table called : DGSClass
Get Started
Instead of using
label = exports.dgs:dgsCreateLabel(0, 0, 0.5, 0.1, "text", true)
DGS = exports.dgs label = DGS:dgsCreateLabel(0,0,0.5,0.1,"text",true)
loadstring(exports.dgs:dgsImportFunction())()-- load functions label = dgsCreateLabel(0,0,0.5,0.1,"text",true) --create a label
We provides Object Oriented Programming
loadstring(exports.dgs:dgsImportOOPClass())()-- load OOP class window = DGSClass:createWindow(0,0,0.5,0.1,"test",true) --create a window with oop label = window:createLabel(0,0,1,1,"label",true) --create a label inside the window label.text = "DGS OOP Test" --set text
Functions
Creation Functions
OOP Functions | POP Functions |
---|---|
createWindow | dgsCreateWindow |
create3DInterface | dgsCreate3DInterface |
createButton | dgsCreateButton |
createBrowser | dgsCreateBrowser |
createCheckBox | dgsCreateCheckBox |
createRadioButton | dgsCreateRadioButton |
createComboBox | dgsCreateComboBox |
createEdit | dgsCreateEdit |
createDetectArea | dgsCreateDetectArea |
createGridList | dgsCreateGridList |
createImage | dgsCreateImage |
createMemo | dgsCreateMemo |
createLabel | dgsCreateLabel |
createProgressBar | dgsCreateProgressBar |
createScrollBar | dgsCreateScrollBar |
createScrollPane | dgsCreateScrollPane |
createTabPanel | dgsCreateTabPanel |
createArrowList | dgsCreateArrowList |
createSwitchButton | dgsCreateSwitchButton |
Non Object Functions
isStyleAvailable | dgsIsStyleAvailable |
getLoadedStyleList | dgsGetLoadedStyleList |
setCurrentStyle | dgsSetCurrentStyle |
getCurrentStyle | dgsGetCurrentStyle |
getScreenSize | guiGetScreenSize |
setInputEnabled | guiSetInputEnabled |
getInputEnabled | guiGetInputEnabled |
setRenderSetting | dgsSetRenderSetting |
getRenderSetting | dgsGetRenderSetting |
getLayerElements | dgsGetLayerElements |
addEasingFunction | dgsAddEasingFunction |
easingFunctionExists | dgsEasingFunctionExists |
removeEasingFunction | dgsRemoveEasingFunction |
getSystemFont | dgsGetSystemFont |
setSystemFont | dgsSetSystemFont |
translationTableExists | dgsTranslationTableExists |
setTranslationTable | dgsSetTranslationTable |
setAttachTranslation | dgsSetAttachTranslation |
General Functions
OOP Functions | POP Functions |
---|---|
getPosition | dgsGetPosition |
setPosition | dgsSetPosition |
getParent | dgsGetParent |
setParent | dgsSetParent |
getChild | dgsGetChild |
getChildren | dgsGetChildren |
getSize | dgsGetSize |
setSize | dgsSetSize |
getType | dgsGetType |
setLayer | dgsSetLayer |
getLayer | dgsSetLayer |
setCurrentLayerIndex | dgsSetCurrentLayerIndex |
getCurrentLayerIndex | dgsGetCurrentLayerIndex |
getProperty | dgsGetProperty |
setProperty | dgsSetProperty |
getProperties | dgsGetProperties |
setProperties | dgsSetProperties |
getVisible | dgsGetVisible |
setVisible | dgsGetVisible |
getEnabled | dgsGetEnabled |
setEnabled | dgsSetEnabled |
getSide | dgsGetSide |
setSide | dgsSetSide |
getAlpha | dgsGetAlpha |
setAlpha | dgsSetAlpha |
getFont | dgsGetFont |
setFont | dgsSetFont |
getText | dgsGetText |
setText | dgsSetText |
bringToFront | dgsBringToFront |
simulateClick | dgsSimulateClick |
animTo | dgsAnimTo |
isAniming | dgsIsAniming |
stopAniming | dgsStopAniming |
moveTo | dgsMoveTo |
isMoving | dgsIsMoving |
stopMoving | dgsStopMoving |
sizeTo | dgsSizeTo |
isSizing | dgsIsSizing |
stopSizing | dgsStopSizing |
alphaTo | dgsAlphaTo |
isAlphaing | dgsIsAlphaing |
stopAlphaing | dgsStopAlphaing |
getPostGUI | dgsGetPostGUI |
setPostGUI | dgsGetPostGUI |
destroy | destroyElement |
isElement | isElement |
getElement | self.dgsElement |
addMoveHandler | dgsAddMoveHandler |
removeMoveHandler | dgsRemoveMoveHandler |
isMoveHandled | dgsIsMoveHandled |
addSizeHandler | dgsAddSizeHandler |
removeSizeHandler | dgsRemoveSizeHandler |
isSizeHandled | dgsIsSizeHandled |
attachToTranslation | dgsAttachToTranslation |
detachFromTranslation | dgsDetachFromTranslation |
getTranslationName | dgsGetTranslationName |
on | addEventHandler(Handled By DGS) |
removeOn | removeEventHandler(Handled By DGS) |
Window
OOP Functions | POP Functions |
---|---|
setSizable | dgsWindowSetSizable |
setMovable | dgsWindowSetMovable |
close | dgsCloseWindow |
setCloseButtonEnabled | dgsWindowSetCloseButtonEnabled |
getCloseButtonEnabled | dgsWindowGetCloseButtonEnabled |
getCloseButton | dgsWindowGetCloseButton |
3D Interface
getBlendMode | dgs3DInterfaceGetBlendMode |
setBlendMode | dgs3DInterfaceSetBlendMode |
getPosition | dgs3DInterfaceGetPosition |
setPosition | dgs3DInterfaceSetPosition |
getSize | dgs3DInterfaceGetSize |
setSize | dgs3DInterfaceSetSize |
getResolution | dgs3DInterfaceGetResolution |
setResolution | dgs3DInterfaceSetResolution |
attachToElement | dgs3DInterfaceAttachToElement |
isAttached | dgs3DInterfaceIsAttached |
detachFromElement | dgs3DInterfaceDetachFromElement |
setAttachedOffsets | dgs3DInterfaceSetAttachedOffsets |
getAttachedOffsets | dgs3DInterfaceGetAttachedOffsets |
setRotation | dgs3DInterfaceSetRotation |
getRotation | dgs3DInterfaceGetRotation |
Arrow List
addItem | dgsArrowListAddItem |
removeItem | dgsArrowListRemoveItem |
setItemText | dgsArrowListSetItemText |
getItemText | dgsArrowListGetItemText |
setItemValue | dgsArrowListSetItemValue |
getItemValue | dgsArrowListGetItemValue |
setItemRange | dgsArrowListSetItemRange |
getItemRange | dgsArrowListGetItemRange |
setItemTranslationTable | dgsArrowListSetItemTranslationTable |
getItemTranslationTable | dgsArrowListGetItemTranslationTable |
setItemStep | dgsArrowListSetItemStep |
getItemStep | dgsArrowListGetItemStep |
getItemTranslatedValue | dgsArrowListGetItemTranslatedValue |
clear | dgsArrowListClear |
Check Box
getSelected | dgsCheckBoxGetSelected |
setSelected | dgsCheckBoxSetSelected |
Radio Button
getSelected | dgsRadioButtonGetSelected |
setSelected | dgsRadioButtonSetSelected |
Combo Box
addItem | dgsComboBoxAddItem |
removeItem | dgsComboBoxRemoveItem |
setItemText | dgsComboBoxSetItemText |
getItemText | dgsComboBoxGetItemText |
clear | dgsComboBoxClear |
setSelectedItem | dgsComboBoxSetSelectedItem |
getSelectedItem | dgsComboBoxGetSelectedItem |
setItemColor | dgsComboBoxSetItemColor |
getItemColor | dgsComboBoxGetItemColor |
getState | dgsComboBoxGetState |
setState | dgsComboBoxSetState |
getBoxHeight | dgsComboBoxGetBoxHeight |
setBoxHeight | dgsComboBoxSetBoxHeight |
getScrollBar | dgsComboBoxGetScrollBar |
setScrollPosition | dgsComboBoxSetScrollPosition |
getScrollPosition | dgsComboBoxGetScrollPosition |
setCaptionText | dgsComboBoxSetCaptionText |
getCaptionText | dgsComboBoxGetCaptionText |
Edit
moveCaret | dgsEditMoveCaret |
getCaretPosition | dgsEditGetCaretPosition |
setCaretPosition | dgsEditSetCaretPosition |
setCaretStyle | dgsEditSetCaretStyle |
getCaretStyle | dgsEditGetCaretStyle |
setWhiteList | dgsEditSetWhiteList |
getMaxLength | dgsEditGetMaxLength |
setMaxLength | dgsEditSetMaxLength |
setReadOnly | dgsEditSetReadOnly |
getReadOnly | dgsEditGetReadOnly |
setMasked | dgsEditSetMasked |
getMasked | dgsEditGetMasked |
setUnderlined | dgsEditSetUnderlined |
getUnderlined | dgsEditGetUnderlined |
setHorizontalAlign | dgsEditSetHorizontalAlign |
getHorizontalAlign | dgsEditGetHorizontalAlign |
setVerticalAlign | dgsEditSetVerticalAlign |
getVerticalAlign | dgsEditGetVerticalAlign |
insertText | dgsEditInsertText |
deleteText | dgsEditDeleteText |
getPartOfText | dgsEditGetPartOfText |
clearText | dgsEditClearText |
replaceText | dgsEditReplaceText |
Ellipse Detect Area
setDebugModeEnabled | dgsEDASetDebugModeEnabled |
getDebugModeEnabled | dgsEDAGetDebugModeEnabled |
Detect Area
setFunction | dgsDetectAreaSetFunction |
Grid List
Image
setImage | dgsImageSetImage |
getImage | dgsImageGetImage |
setUVSize | dgsImageSetUVSize |
getUVSize | dgsImageGetUVSize |
setUVPosition | dgsImageSetUVPosition |
getUVPosition | dgsImageGetUVPosition |
dgs-dxmemo
moveCaret | dgsMemoMoveCaret |
seekPosition | dgsMemoSeekPosition |
getScrollBar | dgsMemoGetScrollBar |
setScrollPosition | dgsMemoSetScrollPosition |
getScrollPosition | dgsMemoGetScrollPosition |
setCaretPosition | dgsMemoSetCaretPosition |
getCaretPosition | dgsMemoGetCaretPosition |
setCaretStyle | dgsMemoSetCaretStyle |
getCaretStyle | dgsMemoGetCaretStyle |
setReadOnly | dgsMemoSetReadOnly |
getReadOnly | dgsMemoGetReadOnly |
getPartOfText | dgsMemoGetPartOfText |
deleteText | dgsMemoDeleteText |
insertText | dgsMemoInsertText |
clearText | dgsMemoClearText |
Label
setColor | dgsLabelSetColor |
getColor | dgsLabelGetColor |
setHorizontalAlign | dgsLabelSetHorizontalAlign |
getHorizontalAlign | dgsLabelGetHorizontalAlign |
setVerticalAlign | dgsLabelSetVerticalAlign |
getVerticalAlign | dgsLabelGetVerticalAlign |
dgs-dxprogressbar
getProgress | dgsProgressBarGetProgress |
setProgress | dgsProgressBarSetProgress |
getMode | dgsProgressBarGetMode |
setMode | dgsProgressBarSetMode |
getVerticalSide | dgsProgressBarGetVerticalSide |
setVerticalSide | dgsProgressBarSetVerticalSide |
getHorizontalSide | dgsProgressBarGetHorizontalSide |
setHorizontalSide | dgsProgressBarSetHorizontalSide |
Scroll Bar
setScrollPosition | dgsScrollBarSetScrollPosition |
getScrollPosition | dgsScrollBarGetScrollPosition |
setScrollSize | dgsScrollBarSetScrollSize |
getScrollSize | dgsScrollBarGetScrollSize |
setLocked | dgsScrollBarSetLocked |
getLocked | dgsScrollBarGetLocked |
dgs-dxscrollpane
getScrollBar | dgsScrollPaneGetScrollBar |
setScrollPosition | dgsScrollPaneSetScrollPosition |
getScrollPosition | dgsScrollPaneGetScrollPosition |
setScrollBarState | dgsScrollPaneSetScrollBarState |
getScrollBarState | dgsScrollPaneGetScrollBarState |
Switch Button
Tab Panel
getState | dgsSwitchButtonGetState |
setState | dgsSwitchButtonSetState |
setText | dgsSwitchButtonSetText |
getText | dgsSwitchButtonGetText |
getSelectedTab | dgsGetSelectedTab |
setSelectedTab | dgsSetSelectedTab |
getTabFromID | dgsTabPanelGetTabFromID |
moveTab | dgsTabPanelMoveTab |
getTabID | dgsTabPanelGetTabID |
createTab | dgsCreateTab |
Tab
deleteTab | dgsDeleteTab |