Usina BRAdvPL Guide
Sign in
← All topics
CLASSUnder review

SButton

SButton():New(nRow,nCol,nType,bAction,oParent,.T.)

Creates an SButton in a visual container.

SButtonAdvPL
01 · OVERVIEW

Overview

The SBUTTON() queue item is the SButton class derived from TControl. TDN shows New with position, type, action and parent; appearance depends on theme. The example uses type 1 as in the source without assigning an undocumented meaning, and passes the dialog explicitly. This page covers only that constructor subset; the consulted page does not specify a formal list of own properties/methods. We do not infer them from the base class. (Sources: refs. 1–2.)

02 · SYNTAX

Syntax

SButton():New(nRow,nCol,nType,bAction,oParent,.T.)

Methods

NewConstructor demonstrated by the official page; subset does not cover every overload.SButton():New(nRow,nCol,nType,bAction,oParent,.T.)
Return value

Created button object.

Return value

SButton object from the constructor.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed641()
    Local oDlg
    Local oButton
    // Fifth argument supplies the parent without relying on active-window state.
    DEFINE DIALOG oDlg TITLE "SButton example" FROM 0,0 TO 150,350 PIXEL
    oButton := SButton():New(12,12,1,{|| oDlg:End()},oDlg,.T.)
    ACTIVATE DIALOG oDlg CENTERED
Return Nil
Expected result

On a compatible client creates a button that closes the dialog, without data changes. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Requires graphical UI. Argument six retains .T. from the official example; additional options/type mappings need release documentation.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. SButton. Hierarquia, exemplo de New e temas. Accessed on 2026-10-28.
  2. Robert Koch. ShowTrb.prw. Exemplo completo analisado; o original omite o pai nessa chamada. Accessed on 2026-10-28.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha